The engine "node" is incompatible with this module. Expected version "12.x". Got "14.8.0"

Viewed 14777

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"
4 Answers

You just have to update your packages.json.

currently :

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

updated :

 "engines": {
     "node": "14.8.0"
 }

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.

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

$ yarn install --ignore-engines

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.

Related