用户工具

站点工具


frontend:nvm

这是本文档旧的修订版!


nvm

nvm - Node Version Manager - Simple bash script to manage multiple active node.js versions.

Installation

curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.32.1/install.sh | bash

then add following lines to your profile:

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm

Usage

Install the latest release version of node:

nvm install node

Install lts version of node:

nvm install --lts  # or lts/boron

Install the specify version of node:

nvm install [version tag, such as v6.9.0]

Install node and its packages:

nvm install [new-version] --reinstall-packages-from=[old-version]

List all available version of node:

nvm ls-remote

Uninstall specify version of node:

nvm uninstall [version tag]

Set sepcify version as default node:

nvm alias default v6.9.0

Accelerate downloading on Chinese Mainland

set $NVM_NODEJS_ORG_MIRROR:

export NVM_NODEJS_ORG_MIRROR=https://npm.taobao.org/mirrors/node

or use it directly:

NVM_NODEJS_ORG_MIRROR=https://npm.taobao.org/mirrors/node nvm install [version]

Reference

frontend/nvm.1476844383.txt.gz · 最后更改: 2023/12/03 10:24 (外部编辑)