nodejs Ubuntu下安装

来源:互联网 发布:以下 表示域名 编辑:程序博客网 时间:2024/05/16 08:44

1.安装

sudo apt-get install nodejs    #安装node.js

sudo apt-get install npm       #安装npm【nodejs包管理器】

sudo npm install -g n           #安装n【多版本管理器】

2.在旧版本的基础上升级【注意在安装模块的过程中发现安装不成功很有可能是版本过低的原因】

Most up-to-date ppa for nodejs https://launchpad.net/~chris-lea/+archive/node.js/

sudo add-apt-repository ppa:chris-lea/node.js  sudo apt-get update  sudo apt-get install nodejs

NOTE: If your system does not have add-apt-repository, it can be installed like so:

sudo apt-get install python-software-properties
3.npm ERR! Error: failed to fetch from registry: supervisor

  1. npm config set registry http://registry.npmjs.org/  




0 0
原创粉丝点击