nodejs

安装

https://nodejs.org/en/download

  • nvm && node
1
2
3
4
5
6
7
8
9
10
11
# Download and install nvm:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash

# in lieu of restarting the shell
\. "$HOME/.nvm/nvm.sh"

# Download and install Node.js:
nvm install 24

# Verify the Node.js version:
node -v # Should print "v24.12.0".
  • pnpm
1
2
3
4
5
# Download and install pnpm:
corepack enable pnpm

# Verify pnpm version:
pnpm -v
  • yarn
1
2
3
4
5
# Download and install yarn:
corepack enable yarn

# Verify yarn version:
yarn -v

替换为国内源

1
2
3
4
5
npm config set registry https://registry.npmmirror.com

pnpm config set registry https://registry.npmmirror.com

yarn config set registry https://registry.npmmirror.com