安裝
->~ npm install -g create-react-app
->~ yarn create react-app my-app || create-react-app my-app
error eslint@5.6.0: The engine "node" is incompatible with this module. Expected version "^6.14.0 || ^8.10.0 || >=9.10.0".
error Found incompatible module
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
Aborting installation.
yarnpkg add --exact react react-dom react-scripts --cwd /Users/xx/testing-react/my-app has failed.
Deleting generated file... package.json
Deleting generated file... yarn.lock
Deleting my-app/ from /xx/testing-react
- 遇到報錯解決辦法
確認問題是node版本過低,安裝nvm切換node版本
macOs-安裝nvm
接著再執行一遍上面的命令,下圖結果為安裝成功
image.png