linux安装node版本管理工具(nvm和fnm)
linux安装node版本管理工具nvm和fnm
- 安装nvm
- 安装fnm
安装nvm
# 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
# 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".