如何更新 Node.js? [英] How do I update Node.js?
本文介绍了如何更新 Node.js?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我做了以下更新我的 npm:
npm 更新 npm -g
但我不知道如何更新 Node.js.有什么建议?(我使用的是 Node.js 0.4.1,想更新到 Node.js 0.6.1.)
解决方案
使用
nvm install version
例如nvm install 12.14.0
安装到机器上nvm use version
使用较新的版本,例如nvm 使用 12.14.0
I did the following to update my npm:
npm update npm -g
But I have no idea how to update Node.js. Any suggestions? (I'm using Node.js 0.4.1 and want to update to Node.js 0.6.1.)
解决方案
Use Node Version Manager (NVM)
It's a Bash script that lets you download and manage different versions of node. Full source code is here.
There is a separate project for nvm for Windows: github.com/coreybutler/nvm-windows
Below are the full steps to use NVM for multiple version of node on windows
- download nvm-setup.zip extract and install it.
- execute command
nvm list available
from cmd or gitbash or powershell, this will list all available version of node - use command
nvm install version
e.g.nvm install 12.14.0
to install on the machine - last once installed use
nvm use version
to use newer version e.g.nvm use 12.14.0
这篇关于如何更新 Node.js?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文