Home > database >  "No version is set for command npm"
"No version is set for command npm"

Time:12-28

I'm attempting to create my react app in VS code. After installing node.js (V 18.12.1), I ran the code to create my app and recieved the following response:

npm create-react-app example

No version is set for command npm Consider adding one of the following versions in your config file at nodejs 16.15.0 nodejs 16.17.0 nodejs 16.17.1 nodejs 16.18.0 nodejs 16.18.1

I attempted the reinstall node.js and clearing my cache. All have yielded the same error.

CodePudding user response:

This could be because you are using a version of Node.js that does not include the npm command. In this case, you can try installing the npm command by running the following command:

npm install -g npm

Try out and see!

CodePudding user response:

You can use this

npx create-react-app example

Can see the detail in official document.

  • Related