코로 넘어져도 헤딩만 하면 그만

styled-component 설치 시 갑자기 뜨는 에러 본문

CODE STATES 44

styled-component 설치 시 갑자기 뜨는 에러

꼬드리 2023. 5. 27. 01:38

프로젝트 처음부터 styled-component로 하는 습관을 들이려고 react를 깔자마자 함께 깔아줬는데, npm run start를 시켰더니 아예 화면이 먹통이 되면서 Babel 에러라는 게 잔뜩 뜨는 현상이 발생했다.

 

그런데 에러를 해결하려 찾다가 문득 돌이켜보니 일전에 이 현상에 관해 동기분들이 얘기 나누던 걸 스치듯 본 기억이 났다. 급하게 스터디 방에 들어가서 검색했고, 이제 전과 달리 styled-component를 쓰기 위해서 

npm install styled-components@latest

꼭 이 명령어로 깔아줘야 한다는 것을 깨달았다. 

...언제 또 바뀔 지 모르겠지만... 적어도 지금은...

 

 

https://github.com/styled-components/styled-components/issues/3998

 

NPM install fails with 'edgesout' warning · Issue #3998 · styled-components/styled-components

Node 18.15.0 NPM 9.6.7 Ubuntu Linux VS Code Regular Next JS project Install works fine with an older version of SC i.e. npm i styled-components@5.3.1 Installed SC a few hours ago in a copy of this ...

github.com

 

위 글을 참고하면 왜 이런 에러가 발생하는지 알 수 있다. (- it might be due to the newly published unstable version 6.0.0-rc.1, published 2 days ago.)

 

최근에 styled-component 내에 sc라는 것이 설치되어서 최신 버전으로 깔아줘야 하는 모양.

 

Comments