安装n
sudo npm install -g n
安装最新稳定版 node
sudo n stable
安装最新版本 node
sudo n latest
删除某个版本
n rm 版本号
使用 n 切换版本
n --回车
ο node/10.15.3
node/11.0.0
查看node版本
node -v
以指定的版本来执行脚本
n use 版本号
查看帮助
n help
Usage: n [options/env] [COMMAND] [args]
Environments:
n [COMMAND] [args] Uses default env (node)
n project [COMMAND] Uses custom env-variables to use non-official sources
Commands:
n Output versions installed
n latest Install or activate the latest node release
n -a x86 latest As above but force 32 bit architecture
n lts Install or activate the latest LTS node release
n <version> Install node <version>
n use <version> [args ...] Execute node <version> with [args ...]
n bin <version> Output bin path for <version>
n rm <version ...> Remove the given version(s)
n prune Remove all versions except the active version
n
n
n ls Output the versions of node available
n uninstall Remove the installed node and npm
Options:
-V,
-h,
-q,
-d,
-a,
Aliases:
which bin
use as
list ls
- rm
stable lts