3

I try to do a yarn add, but I have this error:

The engine "node" is incompatible with this module. Expected version "12.x". Got "14.8.0"
jonrsharpe
  • 107,083
  • 22
  • 201
  • 376
Anroche
  • 422
  • 1
  • 6
  • 12

4 Answers4

3

You just have to update your packages.json.

currently :

 "engines": {
     "node": "12.x"
 }

updated :

 "engines": {
     "node": "14.8.0"
 }
Anroche
  • 422
  • 1
  • 6
  • 12
2

Run these commands:

sudo npm cache clean -f
sudo npm install -g n
sudo n stable

Then in your project directory run:

rm -r ./node_modules
rm ./yarn.lock

After this, yarn install | add | upgrade should work as expected.

P.S. If you are using the npm package manager, instead of rm ./yarn.lock run rm ./package-lock.json.

zilijonas
  • 2,432
  • 3
  • 22
  • 44
1

One time fix for the "the engine node is incompatible with this module" problem.

$ yarn install --ignore-engines
1

I had the same problem when I try to make a new app with react. When I do this

npx create-react-app my-app, I get this error; babel-jest@27.4.5: the engine "node" is incompatible with this module. expected version "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0". got "14.8.0" I solved this problem with this which I found this on other stockoverflow answer. I can't install react using npx create-react-app?

npm install -g create-react-app

This may help you.

Yahya
  • 31
  • 6