반응형

React를 사용해서 오래간만에 프로젝트를 생성하려고 하니까 오류가 발생하면서 프로젝트가 생성 안됩니다.

"You are running `create-react-app` 5.0.0, which is behind the latest release (5.0.1)" 내용으로 create-react-app을 삭제 후 다시 인스톨하라고 합니다.

"npm uninstall -g create-react-app" 명령어를 사용해서 careate-react-app을 삭제합니다.

정상적으로 삭제되면 아래 내용처럼 패키지를 삭제합니다.

두 번째 yarn을 사용해서 global create-react-app을 삭제해야 합니다. 그런데 yarn이 설치가 안되어 있습니다.

yarn은 자바스크립트 패키지 매니저로 npm을 사용해서 설치해줍니다.

"npm install --global yarn" 명령어를 사용해서 설치합니다.

yarn을 설치하고 "yarn global remove create-react-app" 명령어를 실행해서 create-react-app을 삭제합니다.

정상적으로 삭제 후 "npm add create-react-app" 명령어를 사용해서 create-react-app을 다시 설치합니다.

npx create-react-app 명령어를 사용해서 프로젝트를 생성하면 정상적으로 패키지가 설치됩니다.

1. npm uninstall -g create-react-app
2. yarn global remove create-react-app
3. npm add create-react-app
4. npx create-react-app createreact

4가지 명령어를 순차적으로 진행하면 react 버전 오류를 해결할 수 있습니다.

생성된 프로젝트는 정상적으로 컴파일되어 Learn React를 확인할 수 있습니다.

감사합니다.

반응형

+ Recent posts