필자의 경우 yarn global add create-react-app 부분에서 다음과 같은 오류가 발생했습니다.
yarn global v1.22.19
[1/4] Resolving packages...
warning create-react-app > tar-pack > tar@2.2.2: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.
[2/4] Fetching packages...
error chalk@4.1.2: The engine "node" is incompatible with this module. Expected version ">=10". Got "8.10.0"
error Found incompatible module.
info Visit https://yarnpkg.com/en/docs/cli/global for documentation about this command.
The engine "node" is incompatible with this module. Expected version ">=10". Got "8.10.0"
Node.js 버전이 낮아서 생긴 문제라 판단하여 다음과 같은 방식으로 해결했습니다.
1. Node.js 최신 버전 설치하기
Download | Node.js
Node.js® is a JavaScript runtime built on Chrome's V8 JavaScript engine.
nodejs.org
아래 링크에서 Latest LTS Version을 확인하고, 해당 버전을 다운받아 설치합니다.
설치 후, node -v
명령어를 통해 version이 upgrade 되었는지 다시 확인한 후에, npm install -g yarn
을 다시 입력해줍니다.
그리고나서 yarn global add create-react-app을 하고, create-react-app do-it-example을 해봤을 때,
'create-react-app'은(는) 내부 또는 외부 명령, 실행할 수 있는 프로그램, 또는 배치 파일이 아닙니다.
라는 오류 메세지가 떠서, 다음과 같은 방법을 통해 해결했습니다.
2. npm을 통해 설치하기
해당 오류 메세지를 검색해봤는데, yarn으로 install 했을 때 제대로 실행되지 않을 경우, npm을 이용하여 설치하면 된다는 내용이 있어 npm install -g create-react-app
으로 다시 시도했습니다.
성공적으로 설치된 후에 cd do-it-example
로 폴더를 이동하여 yarn start
를 하면 다음과 같이 정상적인 화면이 보이는 것을 확인할 수 있습니다.
📑 참고 자료
eslint@5.6.0: The engine "node" is incompatible with this module. Expected version "^6.14.0 || ^8.10.0 || >=9.10.0" · Issue #53
Is this a bug report? yes Environment Environment: OS: macOS High Sierra 10.13.4 Node: 8.9.4 Yarn: 1.3.2 npm: 6.4.1 Watchman: 4.9.0 Xcode: Xcode 9.2 Build version 9C40b Android Studio: Not Found St...
github.com
create-react-app 명령어 입력시 에러 해결법 : 'create-react-app'은(는) 내부 또는 외부 명령, 실행할 수
create-react-app 명령어를 통해 프로젝트를 생성할 때 아래와 같은 에러가 날때가 있다. create-react-app '프로젝트명' 'create-react-app'은(는) 내부 또는 외부 명령, 실행할 수 있는 프로그램, 또는 배치 파
wotres.tistory.com