'Error in installing React - incompatible engine
So after typing
npx create-react-app myapp
I get this error
error [email protected]: 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.
Solution 1:[1]
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/
Solution 2:[2]
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.
In your case you have to:
- Uninstall node
- install nvm
nvm install 12.13.0nvm install 16.15.0nvm use 16.15.0- try again
npx create-react-app myapp
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Bryce Stampfl |
| Solution 2 |
