linux 安装 nodejs

原文地址:https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora

 

1)定位到nodejs的官方源(如果直接从第二步开始会报找不到nodejs包就是因为少了这一步)

想安装nodejs 4.x 版本的用以下命令

curl --silent --location https://rpm.nodesource.com/setup_4.x | bash -

想安装nodejs 6.x 版本的用以下命令

curl --silent --location https://rpm.nodesource.com/setup_6.x | bash -

 

2)yum 安装 nodejs npm

yum -y install nodejs npm

 

3)安装gcc++ 编译器

yum install gcc-c++ make

 

到此nodejs就安装完成了~~

posted @ 2016-10-24 17:45  Tiac  阅读(1443)  评论(0编辑  收藏  举报