概要
create-react-app
しようとしたら以下のエラーが出て動作しなくなりました
困った...
❯ yarn create react-app my-app
yarn create v1.17.3
[1/4] 🔍 Resolving packages...
[2/4] 🚚 Fetching packages...
[3/4] 🔗 Linking dependencies...
[4/4] 🔨 Building fresh packages...
success Installed "create-react-app@3.1.1" with binaries:
- create-react-app
[#####################################################################################################################################################] 149/149
Creating a new React app in /Users/****/Desktop/my-app.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...
yarn add v1.17.3
[1/4] 🔍 Resolving packages...
[2/4] 🚚 Fetching packages...
error eslint@6.1.0: The engine "node" is incompatible with this module. Expected version "^8.10.0 || ^10.13.0 || >=11.10.1". Got "11.9.0"
error Found incompatible module.
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
解決方法
翻訳無いとほぼ何書いてあるか分からなかったけどこれで解決しました
error eslint@6.1.0: The engine "node" is incompatible with this module. - 掘金
手順
npmのキャッシュを削除する
sudo npm cache clean -f
n
をインストールする
sudo npm install -g n
公式の最新のバージョンをインストールする
sudo n stable
npmの最新バージョンをインストールする
sudo npm install npm@latest
以上の手順で無事動くようになりました