Linux安装nodejs和npm

时间:2023-03-09 04:12:58
Linux安装nodejs和npm

先安装,nvm,即是Node Version Manager(Node版本管理器)

curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash
 或者使用  wget

wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash
之后需要激活nvm:

$ source ~/.nvm/nvm.sh
激活完成后,安装node

nvm install node
安装完成后,切换到该版本

nvm use node

原文:https://blog.****.net/gaomengwang/article/details/77540429