티스토리 뷰

개발

[cra] npx create-react-app error

아나도개발잘하고싶다 2022. 10. 13. 16:26

npx create-react-app를 사용하여 리액트 앱을 생성할 때 아래와 같은 에러가 발생합니다.

 

You are running `create-react-app` 4.0.3, which is behind the latest release (5.0.1).

We no longer support global installation of Create React App.

Please remove any global installs with one of the following commands:
- npm uninstall -g create-react-app
- yarn global remove create-react-app
npx create-react-app app-name 을 실행 시 출력되는 문구

 

메시지에서 제공하는 npm uninstall -g create-react-app 또는 yarn global remove create-react-app을 입력한 후에도 결과는 같기 때문에 에러에 대한 해결방안은 다음과 같습니다.

 

첫 번째 방법은 @latest와 함께 실행합니다.

npx create-react-app@latest react-app

 

두 번째 방법은 패키지를 재설치 후 실행합니다.

npm uninstall -g create-react-app
npm install -g create-react-app
npx create-react-app react-app

 

세 번째 방법은 cache를 삭제 후 실행합니다.

npm uninstall -g create-react-app
npx clear-npx-cache
npx create-react-app my-app

 

댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
글 보관함