Linux安装指定版本Nodejs

学习笔记, Linux  ·  2022-12-21

安装nodejs

通过Linux自带软件库安装的nodejs往往版本较老

可以通过设置代理更新nodejs软件版本

curl -sL https://deb.nodesource.com/setup_18.x | sudo bash -

需要安装哪个版本就设置setup_18.x对应版本数字

sudo apt-get install -y nodejs
nodejs -v
查看版本号,测试安装成功

npm更换淘宝镜像

npm config set registry https://registry.npm.taobao.org
评论
TeohZY. All Rights Reserved. Theme Jasmine by Kent Liao.