ubuntu系统安装最新版本nodejs

#使用源码安装

curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
sudo apt-get install -y nodejs

#使用nvm安装

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"

nvm install v14.16.0

本文来自博客园,作者:广林,转载请注明原文链接:https://www.cnblogs.com/guanglin/p/14797044.html

原文地址:https://www.cnblogs.com/guanglin/p/14797044.html