How do I update Node.js?

2019-01-01 02:53发布

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.)

30条回答
泛滥B
2楼-- · 2019-01-01 03:05

For OS X, I had v5.4.1 and needed the latest version 6 so I went to the Node.js homepage and clicked on one of the links below:

Node.js OS X download links

I then followed the installer and then I magically had the latest version of Node.js and npm.

查看更多
无与为乐者.
3楼-- · 2019-01-01 03:05

For macOS in 2018+ (as ALL of the solutions above are failing for me):

Simply go to the official nodejs site, download the official nodejs package and install it by double clicking. It's the most simple, safe and always-working thing you can do.

查看更多
皆成旧梦
4楼-- · 2019-01-01 03:07

Some Linux distributions such as Arch Linux have Node.js in their package repositories. On such systems it is better to use a standard package update procedure, such as pacman -Suy or analogous apt-get or yum commands.

As of now (Nov 2016) EPEL7 offers a pretty recent version of Node.js (6.9.1 which is an up-to-date LTS version offered on the Node.js home page). So on CentOS 7 and derivatives you can just add EPEL repository by yum install epel-release and yum install nodejs.

CentOS 6/EPEL6 has 0.10.x which isn't supported upstream since Oct 2016.

查看更多
笑指拈花
5楼-- · 2019-01-01 03:08

chocolately was alredy installed on my windows

i followed rob's answer

cinst nodejs.install

after a few minutes latest node is installed

enter image description here

查看更多
像晚风撩人
6楼-- · 2019-01-01 03:11

Today I ran on a Windows Git Bash:

$ npm i node -g

and got the following output:

> node@10.6.0 preinstall C:\Users\X\AppData\Roaming\npm\node_modules\node
> node installArchSpecificPackage

+ node-win-x64@10.6.0
added 1 package and audited 1 package in 23.368s
found 0 vulnerabilities

C:\Users\X\AppData\Roaming\npm\node -> C:\Users\X\AppData\Roaming\npm\node_modules\node\bin\node
+ node@10.6.0
added 2 packages from 1 contributor in 26.089s

Read more about it at https://www.npmjs.com/package/node.

查看更多
何处买醉
7楼-- · 2019-01-01 03:12

Just install the new version over the current folder. I upgraded mine from v4.x to v6.10 on Windows.

查看更多
登录 后发表回答