Error in installing React - incompatible engine - node.js

So after typing
npx create-react-app myapp
I get this error
error eslint#8.15.0: The engine "node" is incompatible with this module. Expected version "^12.22.0 || ^14.17.0 || >=16.0.0". Got "12.13.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 cra-template --cwd /Users/theodosiostziomakas/Desktop/React Tutorial and Project Course (2022)/01_React Basics Tutorial/my-app has failed.
Deleting generated file... package.json
Deleting generated file... yarn.lock
Deleting my-app/ from /Users/theodosiostziomakas/Desktop/React Tutorial and Project Course (2022)/01_React Basics Tutorial
Done.
How to update the node engine? Could it be something else?
Thanks,
Theo.

It says your current version of node is 12.13.0 and you need at least 12.22.0.
The current version of Node is 16.15.0
You can download an updated one at https://nodejs.org/en/download/

You're using a wrong version of node.
IMHO the best way to manage the node version is using nvm.
Nvm is a tool used to switch easy the node version.
Unix version
Windows version
In your case you have to:
Uninstall node
install nvm
nvm install 12.13.0
nvm install 16.15.0
nvm use 16.15.0
try again npx create-react-app myapp

Related

Create-next-app fails nvm node 16 doesn't work

Trying to create a new next app with yarn create next-app.
It fails with this error:
error #eslint/eslintrc#1.0.5: The engine "node" is incompatible with this module. Expected version "^12.22.0 || ^14.17.0 || >=16.0.0". Got "14.15.3"
error Found incompatible module.
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
Aborting installation.
yarnpkg add --exact --cwd /Users/helenkent/Documents/Code/projects/lick-city-vote --dev eslint eslint-config-next has failed.
I upgraded my node version to 16, so when i check with node --version I get v16.13.1
When I tried to make the next app again I got the same error message as before, so its not seeing that I've upgraded node.
Don't really know what I'm doing when upgrading node so first I downloaded and clicked install on 16.13.1 from here https://nodejs.org/en/ but that didnt work when i checked the node version on the cmd line. Next I tried nvm install 16 and nvm use 16. That then showed node version 16.13.1 but like I said above, it still didn't help with the error as its somehow still picking up v14.15.3
Where did I go wrong?
npm install -g npm#latest
npm install node
npm install -g yarn
yarn cache clean
npx create-next-app#latest
Try these steps, I was facing the same error and after searching for 1 hour I found this solution. Although it was for react app, it work for me.
Here is the original solution.
https://stackoverflow.com/a/58252362/11674006

Strapi V4 Error: Can't resolve '#strapi/design-system/themes'

I'm trying to run the new Strapi version 4 application. But it returns this error.
Is there any bug in new strapi v4? or I'm doing wrong anything?
I'm using strapi official guide to start a new project
installation command npx create-strapi-app#latest molla-admin.
NodeJS v16
Windows 11
Error
ModuleNotFoundError: Module not found: Error: Can't resolve '#strapi/design-system/themes' in 'C:\Users\Admin\Desktop\molla-admin\.cache\admin\src'
at C:\Users\Admin\Desktop\molla-<anonymous>:10:1)
You might be thinking #strapi/design-system package is missing right? After that, I also tried to install both #strapi/design-system and #strapi/design-system/themes npm package
Still, it doesn't work. It returns a new error
ModuleNotFoundError: Module not found: Error: Can't resolve '#strapi/icons/CarretDown' in 'C:\Users\Admin\Documents\testing\strapi-v4-app\node_modules\#strapi\helper-plugin\build'
Should I go on for the next missing Module?
For me the issue was solved by installing #strapi/design-system (Node: v14.15.5, npm: 8.1.3)
npm install #strapi/design-system
Node version : 14.18.1
Npm version : 6.14.15
OS : Ubuntu 20.04.3 LTS
Steps I followed:
(I read somewhere that the latest version of node isnt working and
someone mentioned using the 14.18.1 version)
Downgraded NPM to use the 14.18.1 version and not the latest.
npm run build on the strapi project. This gave an error that its
missing #strapi/design-system.
npm install #strapi/design-system, you get another error that its missing #strapi/icons
npm install #strapi/icons . After this step there was an error relating to JSX scritps something to do with reactjs. So, in the next step , I updated Reactjs
npm install --save react#latest
npm run build again and this time SUCCESS!!
The strapi team should mention the issues on their homepage rather that making new users go through hoops to get it working. They need to make it clear that you can run into issues when using certain version of Node etc. As someone mentioned that they are aware of the issue yet no information in the homepage where new users visit to try it out. It should've been placed as a BANNER at the top in BOLD TEXT.
It's a known bug and they are working on a fix.
You have to use yarn in the mean time.
I can confirm that this bug is related to using Node v16. To get around the bug, I first ran:
nvm use 14.18.1
Afterwards, running the following resulted in successful compilation:
npm run build -- --clean
No need to attempt installation of #strapi/design-system.
I got this error because I was using Node v16. There was a message somewhere in my troubleshooting that you have to use A Node version >=10.X.X.X and <=14.X.X.X
I used NVM(Node Version Manager) to switch to 14.17.6 and it works
following solution worked for me:
yarn add #strapi/design-system
yarn add #strapi/icons
work on windows and ubuntu
node v14.15.0
yarn 1.22.17
npm 6.14.8
npm install #strapi/design-system
solution worked for me.
node 16.13.1
npm 8.1.4
macOS 12.0.1 on M1Max

Engine "node" not compatible with this module

I am having issues deploying recent changes made from a Gatsby project to Netlify. Start and build commands for the project locally works fine.
Here is the problem:
error gatsby#3.6.0: The engine "node" is incompatible with this module. Expected version ">=12.13.0". Got "10.24.1"
Here are links to the repo and deployment log:
https://github.com/simonxcode/simonxcode.com
https://app.netlify.com/sites/simonxcode/deploys/60aeec1c22d2e5154232e488
I know this question has been asked numerous times before, but none of the common solutions worked for me. Perhaps I am executing them incorrectly or may be missing something else.
Here are the solutions that I have tried:
execute yarn --ignore-engines from How to ignore incompatible engine "node" error on installing npm dependencies with yarn?
set node variable in .env file (not visible in repo because .gitignore) from Setting Environment Variables for Node to retrieve
//.env file
NODE_ENV=development
add "engine": { "node": ">=12.13.0"} to package.json from The engine "node" is incompatible with this module
Update node with brew update and brew upgrade node from The engine "node" is incompatible with this module
Note 1: Before updating Homebrew, I deleted node_modules/ and yarn.lock files
Note 2: after executing brew postinstall node and brew link --overwrite node, I no longer have access to node, yarn or gatsby when checking with node -v, yarn -v and gatsby -v
I was able to resolve this issue by declaring Node version in Netlify's deployment setting. Build and Deploy environment variables were:
key: NODE_VERSION value: 12.13.0
Screenshot of Environment Variable
Here is more information regarding how to manage dependecies on Netlify.
https://docs.netlify.com/configure-builds/manage-dependencies/#node-js-and-javascript
Lastly, I ran into some other issues with current version of node(16.2.0), so will stick with 12.13.0 for now. ;)
As of 21 November 2021, if Expected version ">=14.15.0". Got "12.13.0". Simply update your Netlify environment variables with:
Key: NODE_VERSION Value: 14.15.0
It works fine for me.
I've run into a similar issue using an outdated NodeJs version.
Check:
npm get
to see if you have strict engine checking set to true.
If so, and if you are not in a position to simply upgrade node:
npm set engine-strict false
This fixed my issue while working on an upgraded version of the project.
I took care of this by using nvm. Nvm is the node version manager. I simply ran nvm install 12.13.0 and everything then worked fine.

NG command is displaying incorrect node version

I am getting below error when I tried to use ng command
Node.js version v11.13.0 detected.
The Angular CLI requires a minimum Node.js version of either v10.13 or v12.0.
Please update your Node.js version or visit https://nodejs.org/ for additional instructions.
When I try to see the node version using node -v, I see node version on my machine is v12.18.3
So from where ng is getting v11.13.0? How do I resolve this issue?
I tried below steps
Clear the NPM cache
Uninstall both node versions from the NVM
Uninstall anything that starts with node in Control Panel\Programs and Features
Install required node versions in NVM
Install Angular CLI
and things started working for me.
Had the same issue. It turns out installed Angular CLI was not compatible with the installed node and npm version. I used the https://stackoverflow.com/a/60258560 to check the compatibility. Then performed following steps:
Uninstall Angular cli
Uninstall Node and NVM
Installed Node version I wanted (10.x).
Installed specific Angular version corresponding to Node v10 which was Angular Cli v11 at this time.
I was also facing the same issue in my Windows machine where the node -v version and the version picked up by ng command were different. This was because my node.js command prompt was picking the version from AppData\Roaming\npm folder. Cleaning up this folder fixed the issue for me.
Uninstall node
Empty the contents from C:\Users<user>\AppData\Roaming\npm
Install the required node version

error eslint#5.6.0: The engine "node" is incompatible with this module. when trying to create-react-app

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.
One of the temporally fix is to run yarn install --ignore-engines
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
I had the same problem, simply doing this solved the problem:
npm install node#latest
Try to uninstall yarn and install it via npm.
npm i create-react-app -g
create-react-app yourappname
Make sure that node is installed!
I had the same problem, try it:
yarn config set ignore-engines true
I re-installed node and updated xcode developer tools. Also, re-installed React on that computer which is running Mojave.
Assuming nvm is installed, use it to see which version of node you're using, then use it to change to a later version.
you can change the version with nvm use <version> and then try again
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.
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 !!!
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?

Resources