클론 코딩을 하기 위해 create-react-app 명령어를 입력하는데 갑자기 아래와 같은 오류를 발견했습니다. 오늘도 stackoverflow에서 그 답을 찾을 수 있었습니다.
오류코드는 다음과 같습니다.
You are running `create-react-app` 4.0.0, which is behind the latest release (4.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
The latest instructions for creating a new app can be found here:
https://create-react-app.dev/docs/getting-started/
npm ERR! code 1
npm ERR! path C:\Users\Ming\Desktop
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c create-react-app my-app
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Ming\AppData\Local\npm-cache\_logs\2021-02-01T12_41_35_049Z-debug.log
이 문제의 해결법은 간단합니다.
에러 코드에서처럼 이제 더이상 create-react-app 을 전역으로 설치해서는 안된다고 합니다.
아래 코드를 순서대로 입력하면 됩니다.
npm uninstall -g create-react-app
npx create-react-app my-app