ubuntu安装nodejs

2016-06-20  本文已影响282人  Shudamu

安装node

1、使用apt-get安装

$ sudo apt-get install nodejs

2、在官网上下载安装

官网:https://nodejs.org/en/

下载版本解压安装

3、官网推荐的方式安装

安装LTS版本

$ sudo curl -sL https://deb.nodesource.com/setup_4.x|sudo-Ebash-

$ sudo apt-getinstall-y nodejs

安装Current版本

$ sudo curl -sL https://deb.nodesource.com/setup_6.x|sudo-Ebash-

$ sudo apt-get install-y nodejs

如果没有curl,使用apt-get安装

$ sudo apt-get install curl

安装n

1、使用npm安装n

$ sudo npm install -g n

2、使用curl安装

$ sudo curl -L http://git.io/n-install | bash

(但是这个方式我安装的时候会报错)

3、使用make install安装

先下载n

https://codeload.github.com/tj/n/zip/master

直接使用unzip 来解压

$ unzip + 文件名.zip

到相应的目录下,使用make install安装

$ make install

上一篇 下一篇

猜你喜欢

热点阅读