我做了以下事情来更新我的npm:

npm update npm -g

但是我不知道如何更新Node.js。有什么建议吗?(我使用Node.js 0.4.1,想更新到Node.js 0.6.1。)


当前回答

简短的回答:

进入该页面:下载| Node.js

下载您平台的安装程序,然后安装它。

其他回答

升级节点到最新版本或指定版本,您可以执行以下操作:

sudo npm install n -g
sudo n 0.10.18   // This will give you the specific version

对于最新的稳定版本:

sudo n stable

对于最新的LTS版本(在Mac上测试)

sudo n lts

如果您安装了Homebrew(仅适用于macOS):

$ brew upgrade node

NPM清理缓存-你忘记清理你的缓存 NPM update -g 这适用于我的Windows,我希望它也适用于你:D

安装nvm(卷) $ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.1/install.sh | bash 或与Wget $ wget - qo - https://raw.githubusercontent.com/creationix/nvm/v0.33.1/install.sh | bash 显示已安装版本列表 $ NVM ls 显示可安装的版本列表 $ NVM ls-remote 安装您喜欢的版本 $ NVM安装v7.5.0 将此版本设置为默认版本 $ NVM别名默认v7.5.0

Ubuntu的:

sudo apt-get install -y curl
curl -sL https://deb.nodesource.com/setup_0.12 | sudo bash -
sudo apt-get install -y nodejs

来源:https://askubuntu.com/questions/426750/how-can-i-update-my-nodejs-to-the-latest-version