Node.js各作業系統更新方式
Mac OS X
如果在Mac OS上有安裝Homebrew的話,這種方式是最方便的:
brew upgrade node
Mac OS X & Linux - n
專門用於管理node/iojs執行檔版本的管理模組 - n
Github網站:https://github.com/tj/n
注意: Windows作業系統上目前不能使用,但有可能可以透過Windows上的git bash shell操作使用:
sudo npm cache clean -f
sudo npm install -g n
sudo n stable
也可以直接定義一個特別的版本編號然後安裝:
sudo n 0.12.7
註: Windows作業系統上可以使用以下類似功能的程式
Mac OS X & Linux - NVM
NVM(Node Version Manager)是專門用來管理Node.js的版本管理程式(shell script)
Github網站:https://github.com/creationix/nvm
先清除Node.js快取:
npm cache clean -f
Check the latest version from https://nodejs.org and install it:
nvm install v0.12.2
nvm use v0.12.2
註: Windows作業系統上可以使用以下兩個類似功能的程式
Windows
Chocolatey是一套可以用來在Windows上用命令列(powershell)安裝軟體套件的程式,類似Mac OS X上的homebrew或ubuntu的apt-get。
安裝Node
直接下載Node官方的安裝檔也可以,這是另一種方式
choco install nodejs.install
cinst nodejs.install
安裝特定版本:
cinst nodejs.install -Version 0.10.26
更新Node
choco upgrade nodejs
cup nodejs