简体   繁体   English

如何在centos 6上安装nodejs 8.x版本? 1个

[英]How to install nodejs 8.x version on centos 6? 1

[root@~]# sudo n stable
install : node-v9.0.0
mkdir : /usr/local/n/versions/node/9.0.0
fetch : https://nodejs.org/dist/v9.0.0/node-v9.0.0-linux-x64.tar.gz
    ######################################################################## 100.0%
installed : v6.11.5

the install version and installed version different. 安装版本和安装版本不同。 run node -v still got v6.11, cant update nodejs, whats the problem? 运行node -v仍然有v6.11,无法更新nodejs,这是什么问题?

Version 6 probably appears in your $PATH before v9. 版本6可能出现在v9之前的$ PATH中。 The node binary that it first finds will be the one used. 它首先找到的节点二进制将是使用的那个。

Also, there might be a node sym-link that points to the wrong version. 另外,可能存在指向错误版本的节点符号链接。 Use which node to see where the bin is. 使用which node查看垃圾箱在哪里。

我建议使用nvm来管理Node版本https://github.com/creationix/nvm这使它更简单

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM