安装nodejs

一。安装

   1.   下载编译好的二进制

[root@VM_14_49_centos nodejs]# wget https://nodejs.org/dist/v8.9.3/node-v8.9.3-linux-x64.tar.xz
--2017-12-17 12:01:08--  https://nodejs.org/dist/v8.9.3/node-v8.9.3-linux-x64.tar.xz
Resolving nodejs.org... 104.20.22.46, 104.20.23.46, 2400:cb00:2048:1::6814:162e, ...
Connecting to nodejs.org|104.20.22.46|:443... connected.

    2.  解压缩

[root@VM_14_49_centos node-v8.9.3-linux-x64]# tar -xvf node-v8.9.3-linux-x64.tar.xz 
[root@VM_14_49_centos nodejs]# ls
node-v8.9.3-linux-x64  node-v8.9.3-linux-x64.tar.xz
[root@VM_14_49_centos nodejs]# cd node-v8.9.3-linux-x64
[root@VM_14_49_centos node-v8.9.3-linux-x64]# ls
bin  CHANGELOG.md  include  lib  LICENSE  README.md  share
[root@VM_14_49_centos node-v8.9.3-linux-x64]# 

    3. 设置环境

[root@VM_14_49_centos node-v8.9.3-linux-x64]# ln -s /root/nodejs/node-v8.9.3-linux-x64/bin/node /usr/local/bin/node
[root@VM_14_49_centos node-v8.9.3-linux-x64]# ln -s /root/nodejs/node-v8.9.3-linux-x64/bin/npm /usr/local/bin/npm 
[root@VM_14_49_centos douban_Website-master]# node -v
v8.9.3
[root@VM_14_49_centos douban_Website-master]# npm -v
5.5.1
[root@VM_14_49_centos douban_Website-master]# 

 

posted @ 2017-12-17 12:55  Python++  阅读(416)  评论(0编辑  收藏  举报