一拯辙、安裝NVM
輸入后會自動安裝
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.4/install.sh| bash
添加nvm到環(huán)境變量
source /home/vagrant/.bashrc
二 蝇棉、安裝node.j 7
nvm install 7? //國外鏡像下載,超級慢,不推薦纱皆,用下面的命令
NVM_NODEJS_ORG_MIRROR=https://npm.taobao.org/mirrors/nodenvminstall 7? ? //飛一搬的感覺
三 募壕、npm配置淘寶鏡像,加速,加速
npm config set registryhttps://registry.npm.taobao.org
四纺非、開始玩耍
su root
cd /vagrant
mkdir testnode
cd testnode
npm init
npm installmocha?--save-dev
簡寫
npm imocha?--save-dev
五哑了、若報錯npm installmocha?--save-dev
加--no-bin-links
npm imocha?--save-dev? --no-bin-links