如何更新当前系统的npm和node版本 (on windows)

今天第一天入职新公司,公司给配的电脑,win7系统,大致看了一下,不是全新,已经被轮过了,检查了下node的版本,发现不是当前最力荐的,npm也不是最新的。所以当即决定更新到最适合的版本。

我比较喜欢用vscode作为编辑器,所以先安装了vscode,以下进行的更新都是在vscode中进行的。

先更新npm:

npm cache clean --force

再执行:

npm update -g

执行完成后,就可以看到当前最新的npm版本了。

C:\Users\Administrator>npm -v
5.6.0

接下来去更新node.js的版本,查了点资料,最后参考的这里:点击看详情,它里面是这么介绍的:

How to Update Node (Windows/macOS) Using Installers on Nodejs.org
========================================================================
The Node.js downloads page includes binary packages for Windows and macOS
 — but why make your life more difficult? The pre-made installers — .msi for Windows
and .pkg for macOS — make the installation process unbelievably efficient 
and understandable. Download and run the file, and let the installation wizard 
take care of the rest. With each downloaded update, the newer versions of Node 
and npm will replace the older version.

Alternatively, macOS users can use the npm and n instructions above.

二话不多说,直接去node.js的download页面:寻找.msi文件,点击下载后,直接运行就可以了,运行结束后,再去看下node的版本:

C:\Users\Administrator>node -v
v8.9.1

至此更新完毕,对于node.js版本的更新并没有使用命令行的模式,也查阅了一些,好像也需要安装一些东西,所以暂且先不用命令行去更新node.js了。

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值