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.
CodePudding user response:
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/
CodePudding user response:
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.0
nvm install 16.15.0
nvm use 16.15.0
- try again
npx create-react-app myapp