Ubuntu安装nodejs

0.更新软件包(如果你此前没有更新过)

sudo apt update
sudo apt install -y curl

1.添加NodeJS软件源

curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -

2.apt命令安装nodejs

sudo apt install -y nodejs

3.查看版本检验安装

node -v
npm -v
posted @ 2026-07-10 15:19  畅畅c  阅读(7)  评论(0)    收藏  举报