1. 下載安裝包,並解壓node
* sudo wget https://nodejs.org/dist/v4.4.5/node-v4.4.5-linux-x64.tar.xz
* sudo tar xvJf node-v4.4.5-linux-x64.tar.xz
* sudo npm install -g yo grunt-cli bower
-
在系統bin目錄創建連接linux
- sudo ln -s /usr/local/soft/install/node-v4.4.5-linux-x64/bin/node /usr/local/bin/node
- sudo ln -s /usr/local/soft/install/node-v4.4.5-linux-x64/bin/npm /usr/local/bin/npm
- sudo ln -s /usr/local/soft/install/node-v4.4.5-linux-x64/bin/bower /usr/local/bin/bower
- sudo ln -s /usr/local/soft/install/node-v4.4.5-linux-x64/bin/grunt /usr/local/bin/grunt
- sudo ln -s /usr/local/soft/install/node-v4.4.5-linux-x64/bin/yo /usr/local/bin/yo
-
測試是否安裝成功npm
- node -v
- npm -v
- grunt -v
- bower -v
- yo --version