[英]How to have a different version of npm for a particular version of Node.js?
If the requirement is to use Node.js v4.x, and npm v3.x, I was able to use 如果要求使用Node.js v4.x和npm v3.x,则可以使用
nvm install --lts=argon
to install Node v4.8.3 LTS. 安装Node v4.8.3 LTS。 But on the Node / npm release page , it says Node v4.8.3 comes with npm 2.15.11.
但是在Node / npm版本页面上 ,它说Node v4.8.3带有npm 2.15.11。 And npm 3.x comes with only Node v5.x.
而且npm 3.x仅带有Nodev5.x。
In this case, how can we make npm v3.x while keeping Node at version 4.x? 在这种情况下,如何使npm v3.x保持Node的版本为4.x?
(and since npm v3.x can be 3.3.6 to 3.10.10, which version should be installed?) (由于npm v3.x可以为3.3.6至3.10.10,应安装哪个版本?)
I think I found the answer. 我想我找到了答案。 It is to use
npm install
to upgrade itself: 它是使用
npm install
进行自我升级:
npm install npm@3.10.10 -g
(or any version you want). (或您想要的任何版本)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.