ubuntu安装nodejs

ubuntu安装nodejs

ubuntu 安装 nodejs 记录备忘。

安装

1
2
3
4
5
6
7
# Using Ubuntu
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo apt-get install -y nodejs

# Using Debian, as root
curl -fsSL https://deb.nodesource.com/setup_18.x | bash -
apt-get install -y nodejs

查看版本

1
node -v

切换淘宝源

1
2
3
npm config get registry  # 查看源
npm set registry https://registry.npm.taobao.org # 切换淘宝源
npm config get registry # 查看是否切换成功

更新node.js版本

1
2
sudo npm install n -g # 全局安装node.js
sudo n stable # 码通过n模块,将node.js更新为最新发布的稳定版。

ubuntu安装nodejs
https://ywmy.xyz/2022/04/22/ubuntu安装nodejs/
作者
ian
发布于
2022年4月22日
许可协议