1、終端輸入:sudo apt-get install nodejs
2、終端輸入:sudo apt-get install npm
//獲取root權限
1、sudo passwd root //設置root密碼
2、輸入新的密碼
3、再次輸入
4、ok!
5、終端輸入:su
6、輸入密碼
7、ok!獲取權限了
//設置cnpm
1、終端輸入:$ npm install -g cnpm --registry=https://registry.npm.taobao.org
2、ok!設置好了,試試吧!