Leif160519的blog Leif160519的blog

——————

目录
Linux安装最新版node
/    

Linux安装最新版node

node官网:http://nodejs.cn/download/

1.下载Linux版本二进制包:

wget https://npm.taobao.org/mirrors/node/v12.11.1/node-v12.11.1-linux-x64.tar.xz

2.解压

tar -xvf node-v12.11.1-linux-x64.tar.xz

3.重命名并复制到指定目录中

mv node-v12.11.1-linux-x64 nodejs
cp -r nodejs /usr/local/src

4.建立软连接,变为全局

ln -s /usr/local/src/nodejs/bin/npm /usr/local/bin/ 
ln -s /usr/local/src/nodejs/bin/node /usr/local/bin/

5.查看版本

[root@centos ~]# node -v
v12.11.1
[root@centos ~]# npm -v
6.11.3

6.换源(淘宝源)

临时换源

npm --registry https://registry.npm.taobao.org install express

永久换源

npm config set registry https://registry.npm.taobao.org

“The first 90% of the code accounts for the first 90% of the development time. The remaining 10% of the code accounts for the other 90% of the development time.” – Tom Cargill

标  题Linux安装最新版node
作  者Leif160519
出  处https://github.icu/articles/2019/10/12/1570869422170.html
关于博主:坐标南京,运维工程师,如有问题探讨可以直接下方留言。
声援博主:如果您觉得文章对您有帮助,可以评论、订阅、收藏。您的鼓励是博主的最大动力!