linux安装node版本管理工具nvm和fnm
安装nvm
bash
# Download and install nvm:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.2/install.sh | bash
# in lieu of restarting the shell
\. "$HOME/.nvm/nvm.sh"
# Download and install Node.js:
nvm install 16
# Verify the Node.js version:
node -v # Should print "v16.20.2".
nvm current # Should print "v16.20.2".
# Verify npm version:
npm -v # Should print "8.19.4".
安装fnm
bash
# Download and install fnm:
curl -o- https://fnm.vercel.app/install | bash
# Download and install Node.js:
fnm install 16
# Verify the Node.js version:
node -v # Should print "v16.20.2".
# Verify npm version:
npm -v # Should print "8.19.4".