简体   繁体   中英

Use specific Node version in combination with specific npm version

For a client's web project I work with two other developers. The frontend is built with quite a setup (gulp, foundation, bower, ...) and started a few years ago. They both use a (never updated)

 I tried npm install npm@5.6.0<\/code> which then changes the used npm version, but also changes the used node version back.

But is there a way to work with exactly this combination of versions<\/strong> the other developers use in my project?

After switching node<\/code> versions with nvm use<\/code> (and confirming you switched with node --version<\/code> ), you should globally<\/strong> update\/downgrade npm<\/code> with:

npm install -g npm@5.6.0 // -g arg is important

Find where your nvm is installed .eg:

在此处输入图像描述

Then you can explicitly call your desired npm version like:

your\path\..\AppData\Roaming\nvm\v12.10.0\npm -help

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