发布于 

Ubuntu安装Node.js

Ubuntu安装Node.js

通过PPA安装

1
curl -sL https://deb.nodesource.com/setup_18.x -o nodesource_setup.sh
1
sudo bash nodesource_setup.sh
1
sudo apt install nodejs
1
node -v

通过这种方式安装,由于nodejs包中已经包含了node和npm,所以不需要单独安装npm了。