1.安装python-software-properties
sudo apt-get install python-software-properties
2.添加ppa
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
3.安装nodejs和npm
sudo apt-get install nodejs
4.查看版本
$ node -v
v8.11.1
$ npm -v
5.6.0
5.配置npm仓库
sudo npm install -g nrm
$ nrm ls
* npm ---- https://registry.npmjs.org/
cnpm --- http://r.cnpmjs.org/
taobao - https://registry.npm.taobao.org/
nj ----- https://registry.nodejitsu.com/
rednpm - http://registry.mirror.cqupt.edu.cn/
npmMirror https://skimdb.npmjs.com/registry/
edunpm - http://registry.enpmjs.org/
$ nrm use taobao
Registry has been set to: https://registry.npm.taobao.org/
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:mmqy2019@163.com进行举报,并提供相关证据,查实之后,将立刻删除涉嫌侵权内容。
长按识别二维码并关注微信
更方便到期提醒、手机管理