简体   繁体   中英

`npx create-react-app my-app` is trying to use the wrong npm

I'm using a MacBook Pro.

I have a fresh install of nvm . I set the node version and it's set to 16.17.0 and npm -v and nix -v both show 8.15.0.

When I run npx create-react-app my-app it fails and the log shows the following...

info using npm@6.5.0

Where is this coming from, and how do I fix it?

I originally installed a number of recent and not-so-recent versions of node.js with Homebrew and I had the exact same error. I completely annihilated every instance of node.js and npm from /usr/bin and /usr/local/bin. There is nothing related in my $PATH , but there must be a reference somewhere.

Well, I played around and discovered that installing version 14.0.0 of node.js plays nicely and my app is now created... but I am now getting...

npm WARN npm npm does not support Node.js v14.0.0

I'm still confounded by the original error because I also tried with 12.0.0 and it tried to work and failed in a nice manner with an error that I could play along with. I'm still baffled by the original error.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM