NVM 用法

通过 Homebrew 安装

1
% brew install nvm

查看已安装软件信息

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
% brew info node                                                               

# 输出结果:
node: stable 9.11.1 (bottled), HEAD
Platform built on V8 to build network applications
https://nodejs.org/
/usr/local/Cellar/node/9.2.1 (5,125 files, 49.5MB)
Poured from bottle on 2017-12-12 at 16:54:22
/usr/local/Cellar/node/9.4.0 (5,125 files, 49.7MB) *
Poured from bottle on 2018-01-29 at 17:08:45
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/node.rb
==> Dependencies
Build: python@2 ✘, pkg-config ✔
Recommended: icu4c ✘
Optional: openssl ✘
==> Options
--with-debug
Build with debugger hooks
--with-openssl
Build against Homebrews OpenSSL instead of the bundled OpenSSL
--without-completion
npm bash completion will not be installed
--without-icu4c
Build with small-icu (English only) instead of system-icu (all locales)
--without-npm
npm will not be installed
--HEAD
Install HEAD version
==> Caveats
Bash completion has been installed to:
/usr/local/etc/bash_completion.d

安装、卸载、升级

1
2
3
4
5
% brew install node

% brew uninstall node

% brew upgrade node

安装 node

1
% nvm install 6.14.4

切换 node 版本

1
% nvm use 6.14.4