Web Tools
- node
- npm
- pnpm
- yarn
node
install
use official download, or use nodesource
below
bash
# Download and import the Nodesource GPG key
sudo apt-get update
sudo apt-get install -y ca-certificates curl gnupg
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
# Create deb repository
NODE_MAJOR=20 # 16 18 20 21
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list
# Run Update and Install
sudo apt-get update
sudo apt-get install nodejs -y
Test installation using
bash
node -v
npm version
npx -v
npm
install
to download the latest version of npm, on the command line, run the following command:
shell
npm install -g npm
check
shell
node -v
npm -v
pnpm
install
shell
npm install -g pnpm
yarn
查看当前 yarn 版本
shellyarn -v
获取当前最新 yarn 版本
shellnpm view yarn version
使用npm升级 yarn 版本
shellnpm install yarn@1.22.19 -g
查看升级后版本
shellyarn -v
QA
nuxt dev catch error
ExperimentalWarning: The Fetch API is an experimental feature. This feature could change at any time
solve or upgrade your node/npm/pnpm