13

I am trying to create a React App and I am getting the following error in my console.

Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...

yarn add v1.10.1
info No lockfile found.
[1/4]   Resolving packages...
warning react-scripts > eslint > file-entry-cache > flat-cache > circular-   json@0.3.3: CircularJSON is in maintenance only, flatted is its successor.
[2/4]   Fetching packages...
error eslint@5.6.0: The engine "node" is incompatible with this module.    Expected version "^6.14.0 || ^8.10.0 || >=9.10.0". Got "9.5.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      /Volumes/server2/Desktop/JavaScript/birdcage has failed.

  Deleting generated file... package.json
  Deleting birdcage / from /Volumes/server2/Desktop/JavaScript
  Done.

I have tried brew upgrade node but that didn't seem to work. Any ideas on how this can be fixed would be greatly appreciated.

Håken Lid
  • 22,318
  • 9
  • 52
  • 67
AltBrian
  • 2,392
  • 9
  • 29
  • 58

11 Answers11

15

One of the temporally fix is to run yarn install --ignore-engines

gildniy
  • 3,528
  • 1
  • 33
  • 23
  • Great suggestion! Where can I set the engine flag? I dont have one set in the eslint.rc file, so it must got to a default. – eagercoder Apr 01 '20 at 06:21
14

I was facing the same issue, try to add "--use-npm" at the end of create react app commend.

create-react-app appname --use-npm

Gopi Kannan
  • 151
  • 1
  • 6
3

I had the same problem, simply doing this solved the problem:

 npm install node@latest
Nafis
  • 1,020
  • 17
  • 36
1

Try to uninstall yarn and install it via npm.

  1. npm i create-react-app -g
  2. create-react-app yourappname Make sure that node is installed!
Nightroit
  • 11
  • 3
1

I had the same problem, try it:

yarn config set ignore-engines true
Erick Amoedo
  • 475
  • 1
  • 4
  • 9
0

I re-installed node and updated xcode developer tools. Also, re-installed React on that computer which is running Mojave.

AltBrian
  • 2,392
  • 9
  • 29
  • 58
0

Assuming nvm is installed, use it to see which version of node you're using, then use it to change to a later version.

Martin Dimmock
  • 103
  • 2
  • 8
0

you can change the version with nvm use <version> and then try again

rgreso
  • 496
  • 1
  • 7
  • 19
0

In my Ubuntu 18.04 had a native version from the OS installed that not listed by NVM.

I removed it and then I ran:

Firstly run, nvm install 14.5.0 then run, nvm use 14.5.0

And the installation completed properly.

Marcello B.
  • 4,177
  • 11
  • 45
  • 65
0

i had same issue when i was adding router plugin to vue-cli with npx and yarn as well.. In pyhton virtual environment i have updated node version from 8.x.x to 16.x.x and used command nvm use 16.x.x but still problem persists .. i was actually executing command as root .. so nvm is using node version as 8.x.x only ..

after long time i realised executing command with sudo was the issue and then executed as a normal user...

this solution worked for me !!!

Lavanya Rani
  • 194
  • 1
  • 3
0

As the warning said, I updated node via nvm to the version required. For me having the latest node lts version was enough.

nvm install "lts/*" --reinstall-packages-from="$(nvm current)"

But even after upgrading node, yarn still gave the error.

The problem was npm was still executed from the old .bin path of previous node version. nvm also installs latest version of npm in respective local .bin folder for the node version installed.

I used the following commands then,

nvm install-latest-npm: Attempt to upgrade to the latest working npm on the current node version

nvm install --latest-npm: After installing, attempt to upgrade to the latest working npm on the given node version

After this, it worked properly.

Reference: How can I change the version of npm using nvm?

Badal Saibo
  • 2,499
  • 11
  • 23