JavaScript使用指南
Node.js使用指南
使用apt安装Node.js
sudo apt-get update
sudo apt-get install -y nodejs npm
检查是否安装成功。
$ node -v
v18.13.0
$ npm -v
9.2.0
Bianbu源中的Node.js默认版本为v18.13.0,若想使用特定版本的Node.js,请使用NVM安装。
使用NVM安装特定版本Node.js
安装NVM
根据 https://github.com/nvm-sh/nvm
提供的命令行下载并执行安装脚本,请根据该仓库替换最新的NVM版本号。
使用curl:
sudo apt install curl
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
或使用wget:
sudo apt install wget
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash