Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
336 views
in Technique[技术] by (71.8m points)

node.js - 如何使用NVM正确升级节点(How to properly upgrade node using nvm)

Is it possible to upgrade node right in place, instead of manually installing the latest stable version?

(是否可以就地升级node ,而不是手动安装最新的稳定版本?)

I have installed node.js version 5.0 with nvm , but now I want to update it to 5.4 .

(我已经使用nvm安装了node.js版本5.0 ,但是现在我想将其更新为5.4 。)

I'm trying to avoid having to manually reinstall all of my global packages ( eg by running npm install -g grunt-cli bower yo yoman-angular-generator blabla blablablabla ...).

(我试图避免手动重新安装所有全局软件包( 例如,通过运行npm install -g grunt-cli bower yo yoman-angular-generator blabla blablablabla ...)。)

  ask by Boris Burkov translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

This may work:

(这可能起作用:)

nvm install NEW_VERSION --reinstall-packages-from=OLD_VERSION

For example:

(例如:)

nvm install 6.7 --reinstall-packages-from=6.4

then, if you want, you can delete your previous version with:

(然后,如果需要,您可以使用以下方法删除以前的版本:)

nvm uninstall OLD_VERSION

Where, in your case, NEW_VERSION = 5.4 OLD_VERSION = 5.0

(在您的情况下,NEW_VERSION = 5.4 OLD_VERSION = 5.0)

Alternatively, try:

(或者,尝试:)

nvm install stable

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...