Ubuntu环境下安装nodejs和npm


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/


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM