腾讯云 Centos 6安装 Node 6/7/8

腾讯云上安装的centos 6 安装高级node 版本比较蛋疼,摸索了下用下面的曲线方式:

wget https://nodejs.org/download/release/v7.9.0/node-v7.9.0-linux-x64.tar.gz
tar -zvxf node0v7.*
ln -s /root/node-v7.9.0-linux-x64/bin/node /usr/bin/node
[root@VM_68_70_centos bin]# ln -s /root/node-v7.9.0-linux-x64/bin/npm /usr/bin/npm
[root@VM_68_70_centos bin]# node -v
v7.9.0
[root@VM_68_70_centos bin]# npm -v
-bash: /usr/local/bin/npm: 没有那个文件或目录
[root@VM_68_70_centos bin]# ln -s /root/node-v7.9.0-linux-x64/bin/npm /usr/local/bin/npm
[root@VM_68_70_centos bin]# npm -v
4.2.0
[root@VM_68_70_centos bin]# which node
/usr/bin/node
[root@VM_68_70_centos bin]# which npm
/usr/local/bin/npm
© DeveWork.com 2018. sitemap  统计 Updated at 2018-01-06 20:45

results matching ""

    No results matching ""