Skip to content

Web Tools

  • node
  • npm
  • pnpm
  • yarn

node

install

refer

use official download, or use nodesource below

new refer

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

refer

shell
npm install -g pnpm

yarn

  1. 查看当前 yarn 版本

    shell
    yarn -v
  2. 获取当前最新 yarn 版本

    shell
    npm view yarn version
  3. 使用npm升级 yarn 版本

    shell
    npm install yarn@1.22.19 -g
  4. 查看升级后版本

    shell
    yarn -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

吃好喝好 快乐地活下去