-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathnvm.node.txt
100 lines (83 loc) · 4.89 KB
/
nvm.node.txt
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
┏━━━━━━━━━┓
┃ NVM ┃
┗━━━━━━━━━┛
ALTERNATIVES ==> # - nvm (preferred for Unix): Unix only
# - nvm-windows (preferred on Windows): Windows only
# - n: Unix only
# - nave: less high-profile
# - nodeenv:
# - environment must be specified by filepath not by name
# - integrated with virtualenv (Python)
# - nvs: not well maintained
# - nodebrew: not well maintained
# - nodist: not well designed, not well maintained
# - fish-nvm: uses Fish
#Version switching on cd:
# - avn: not well maintained
VERSION ==> #0.40.2
GOAL ==> #Manage different versions of Node.
INSTALL ==> #Must install via manual Bash script, not npm
#There also ways to upgrade via Bash
GLOBAL PACKAGES ==> #Each version has its own set of global packages
VERSION #Can be:
# - vVERSION
# - node|stable (latest current version)
# - lts/* (latest LTS version)
# - lts/NAME (latest LTS version named NAME)
# - lts/-NUM (NUM latest LTS version)
# - unstable (always v0.11)
# - iojs: IO.js
# - system: version installed by OS
nvm version[-remote] VERSION #Normalize "VERSION" string
.nvmrc #Content is def VERSION
#Looked in project root directory or any parent (including ~/.nvmrc)
#Default for nvm COMMAND, not for "cd"
#Can include #COMMENT
#Can validate it using `nvmrc` Node module
nvm install|use --save #Creates|saves to .nvmrc
nvm [un]install|use|run|exec|
ls-remote|version-remote
--lts[=NAME] #Only for those versions
nvm install [VERSION] #Install node@VERSION in ~/.nvm/versions/node/VERSION/
-s #Install node from source
-b #Invert (def)
--no-progress #
--alias ALIAS #Run nvm alias ALIAS VERSION too
--default #Same as --alias default
nvm uninstall [VERSION] #
nvm use [VERSION] #Make default binary point to this VERSION (by changing $PATH)
--silent #
nvm current #Show current VERSION
~/.nvm/default-packages #Newline-separated list of PKG
#Will run npm install -g on each of them when installing a new Node version
nvm install
--skip-default-packages #
nvm install-latest-npm
nvm install --latest-npm #Install latest npm
#On Windows, should use npm-windows-upgrade instead
nvm alias ALIAS VERSION #Allow using ALIAS as a VERSION
#Use "default" for the one used on new shell
nvm unalias ALIAS #
nvm alias [STR] #Show all current aliases (starting with STR)
nvm run [VERSION] ... #Calls node ...
nvm exec [VERSION] ... #Calls bash ...
nvm ls [VERSION] #Show which versions are installed
--no-alias #Do not show aliases
nvm ls-remote [VERSION] #Show which versions can be installed
nvm which [VERSION] #Prints node path
--silent #Only prints node path
nvm unload|deactivate #Undo nvm permanently|temporarily
--silent #
nvm reinstall-packages [VERSION]
nvm install
--reinstall-packages-from=VERSION #Redo npm install -g, but with VERSION
nvm cache dir #Prints dir (~/.nvm/.cache/) where Node tarballs are cached
nvm cache clear #
ENVVAR NVM_NODEJS_ORG_MIRROR #Mirror for Node binaries.
#Def: https://nodejs.org/dist
#Others:
# - (China) https://npmmirror.com/mirrors/node
ENVVAR NVM_AUTH_HEADER #Authorization: STR [C]
nvm --no-colors
nvm set-colors STR
ENVVAR NVM_COLORS #Custom colors