npm 升级node.js_通过NPM升级Node.js

npm 升级node.js

This method of upgrading node is now unstable and should not be used. The best way to manage Node.js versions is to use NVM: Node Version Management.!

现在,这种升级节点的方法不稳定,不应该使用。 管理Node.js版本的最佳方法是使用NVM:节点版本管理。

I was recently installing a utility via NPM when I learned that my version of Node.js itself was out of date.  No worries -- simply upgrade my Node.js install and move forward.  Of course I could just hit nodejs.org and get the new image, but figured there had to be an easier way.  It turns out there is -- you can upgrade your local Node.js with NPM:

当我得知我的Node.js版本本身已过时时,我最近通过NPM安装了一个实用程序。 不用担心-只需升级我的Node.js安装并继续前进。 当然,我可以单击nodejs.org并获取新图像,但认为必须有一种更简单的方法。 事实证明,您可以使用NPM升级本地Node.js


sudo npm cache clean -f
sudo npm install -g n
sudo n stable


The n package represents a Node helper, and running the last command upgrades node to the latest stable version.  Instead of using "stable", you could specify a desired version:

n软件包表示节点帮助程序,运行最后一个命令会将节点升级到最新的稳定版本。 您可以指定所需的版本,而不是使用“稳定”版本:


sudo n 0.8.21


Once your install is complete, you can confirm you version with another command:

安装完成后,可以使用另一个命令确认版本:


node -v


It's quite nice that you can upgrade Node.js right from npm;  it's like Inception...or something.

您可以直接从npm升级Node.js真是太好了。 就像《盗梦空间》之类的。

翻译自: https://davidwalsh.name/upgrade-nodejs

npm 升级node.js

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值