Compare commits

..

367 Commits

Author SHA1 Message Date
Jordan Harband
0ccd099bff v0.39.2 2022-10-13 16:25:25 -07:00
Jordan Harband
f062cca179 [Refactor] nvm install/nvm_install_default_packages: move "get" logic inside helper 2022-10-13 15:03:36 -07:00
Jordan Harband
0698ede92d [Tests] update test mocks 2022-10-13 12:08:31 -07:00
Jordan Harband
71a73b17cf [Fix] --help: proper default NVM_COLORS info 2022-10-13 13:34:43 -07:00
Jordan Harband
0ae8409f4f [Fix] nvm install-latest-npm: ensure npm 9 does not install on unsupported nodes 2022-09-08 14:59:25 -07:00
ryenus
5e9791c4f8 [perf] nvm_print_versions: re-implement using awk
reducing `nvm ls-remote` from almost 20s to below 2s.

Signed-off-by: ryenus <ryenus@gmail.com>
2022-06-05 13:27:03 +08:00
Maxim Lepekha
7c929f8742 [Fix] install.sh: support ~/.zprofile 2022-09-21 22:38:50 +02:00
Josh Kelley
c6269e0ac2 [Fix] Don't override Mac M1 architecture for node ^14.17
Fixes #2743

Co-authored-by: Josh Kelley <joshkel@gmail.com>
Co-authored-by: Raz Luvaton <16746759+rluvaton@users.noreply.github.com>
Co-authored-by: Jordan Harband <ljharb@gmail.com>
2022-03-30 10:53:01 -04:00
BatemaDevelopment
28b3b0e324 [readme] Update Alpine Linux Section
- Update install directions to include `python3`, instead of `python2`, which is deprecated since Alpine 3.13.
2022-09-27 06:44:13 -04:00
Peter Dave Hello
b133f6619d [Dockerfile] Update base image from Ubuntu 18.04 to 20.04, cc #2877 2022-09-07 16:36:29 +08:00
Robert Shuford
4893128c61 [readme] optimize calling of nvm version in zsh 2022-08-25 21:12:36 -04:00
etienne-miralytik
8fd948001e [readme] Fix Ansible Linting Errors
Fixes #2860.

This fixes these two linting errors:
- fqcn-builtins: Use FQCN for builtin actions.
- name: All names should start with an uppercase letter. (name[casing])
2022-08-24 18:58:38 +02:00
Jer Wilson
5a4e9184f1 [readme] cdnvm(): handle failed dir change
If cd command fails, return whatever cd returned, instead of marching ahead
2022-06-27 17:21:45 -07:00
SnipUndercover
95269ff055 [readme] Fix Git Install instruction list structure 2022-05-26 01:13:00 +02:00
Danny Neumann
2cfced740a [Docs] Add note about creating .bashrc file *as well as* .bash_profile.
My problem was that I didn't have EITHER file, and hopefully the notes will help someone else reading the docs.
2022-01-27 10:53:36 -08:00
Robert Shuford
35758b75ed [Tests] github actions removed homebrew and broke shellcheck
See https://github.com/actions/runner-images/issues/6283
2022-10-06 11:13:47 -04:00
Robert Shuford
d451e261ed [Tests] node 18 no longer builds in travis-ci 2022-10-05 10:09:00 -04:00
Jordan Harband
a82edf40ba [Robustness] avoid a clobbered ls
Fixes #2824
2022-06-02 12:25:55 -07:00
Jordan Harband
ef3b20c21e [readme] add logo 2022-04-22 16:53:49 -07:00
Dani Schuhman
01886b4243 [meta] Update CODE_OF_CONDUCT to current version 2022-04-15 10:56:26 -04:00
Jordan Harband
bd083ff367 [readme] minor cleanup 2022-04-11 14:09:37 -07:00
deepakchethan
9e884b8d7b [Fix] nvm install: show proper version in .nvmrc install instructions 2022-03-22 18:58:18 +05:30
Ponder
7d86701067 [readme] fish: send output from load_nvm to /dev/stderr 2022-04-01 13:00:58 -04:00
legendecas
c367d7daa0 [Docs] fix fish load_nvm variable interpolations 2022-03-28 23:28:53 +08:00
Antony Tse
d157cac689 [readme] Correct typos in "Macs with M1 chip" section 2022-03-09 09:41:48 +00:00
Jordan Harband
39d9a42c35 [Fix] install.sh: error out if the install instructions are not followed 2022-02-08 10:40:11 -08:00
Kai
2c0c34f10e [Docs] HTTP => HTTPS 2022-01-16 14:25:11 +01:00
Jordan Harband
c2f740ab38 [patch] HTTP -> HTTPS 2022-01-18 12:49:57 -08:00
Jordan Harband
6cfaede5a0 [Fix] install: better error message when xcode command line tools are needed
Fixes #2697. Fixes #2663.
2021-11-27 22:16:14 -08:00
Luke Arms
1875fe8b40 [Fix] avoid OpenBSD nvm install error when /sbin/init doesn't exist
`nvm install` fails with "Binary download failed, trying source" when
- running on Bash;
- errtrace (`set -E`) is enabled;
- an ERR trap uses `exit` to return a non-zero status; and
- /sbin/init doesn't exist.

Resolved by moving `ls -dl /sbin/init` to the following `if` statement.
In this context, returning non-zero isn't an error and the ERR trap
isn't executed.
2021-12-26 15:31:53 +11:00
Luke Arms
81f0f3ec19 [Fix] set -E: Add test for node install on Bash with an ERR trap and set -E 2021-12-27 16:02:25 +11:00
lsfxz
fb4538b360 [Fix] add missing local (handle nonexisting /sbin/init a bit more cleanly) 2021-11-17 16:59:53 +01:00
Luke LaFountaine
d004c6b064 [readme] clarify instructions for running Node on M1 Mac 2021-12-03 16:52:18 -05:00
Bob Bregant II
79ad72d116 [Fix] Update nvm_extract_tarball to support OpenBSD
Fixes #2660.
2021-12-19 02:58:18 +00:00
Bob Bregant II
ccd442d833 [Refactor] add nvm_extract_tarball to consolidate extraction logic 2021-12-19 02:58:18 +00:00
Jordan Harband
9600617c52 v0.39.1 2021-12-17 14:55:52 -08:00
Jordan Harband
5cc74a6736 [Tests] fix failing test 2021-12-17 13:21:29 -08:00
Jordan Harband
aa57406ede [Fix] ensure unload removes nvm_normalize_lts 2021-12-17 13:55:14 -08:00
Jordan Harband
0f62be6fdd [Dev Deps] update markdown-link-check 2021-12-17 12:37:15 -08:00
Jordan Harband
c4c7690dec [Fix] ls-remote/install: support lts/-X patterns in installs
Fixes #2692
2021-12-16 23:01:05 -08:00
Jordan Harband
aed1d732d7 [Fix] ls-remote/install: properly handle lts/x patterns 2021-12-16 22:58:06 -08:00
Jordan Harband
0b4cd8df6c [Refactor] create nvm_normalize_lts helper 2021-12-16 22:55:02 -08:00
Jordan Harband
430860a8be [Fix] nvm alias/nvm_list_aliases: support lts/ aliases
See #2692
2021-12-16 15:54:38 -08:00
Jordan Harband
2459d17741 [Tests] update test mocks 2021-12-16 23:13:15 -08:00
Varun Sharma
6cc90a4b8d [actions] add step security runner 2021-11-22 07:20:50 -08:00
Jordan Harband
81fc05684d [Tests] nvm_get_download_slug: add unit tests 2021-12-02 23:33:20 -08:00
Ankit Kumar
328dd5004e [Fix] nvm_get_download_slug: better architecture selection for M1 Macs
If the node version is below 16.0.0 then nvm will select x86_64 architecture, else arm64 architecture.
2021-11-21 15:59:39 +05:30
Jérôme Foray
4856407d26 [Fix] install: fix method=script install condition
Fixes #2665; see 8937917
2021-11-30 16:07:22 +01:00
Jordan Harband
275001b066 [Tests] fix windows WSL tests 2021-11-25 19:35:39 -08:00
Jordan Harband
89379176ac [Fix] install: properly check for curl/wget 2021-11-25 14:26:35 -08:00
Robert Elliot
30486b9bd9 [readme] Balance the if statement in bash example
Nesting the `elif` at the same level as the `if` and `fi` makes it clear which code applies to which branch (no .nvmrc file / found .nvmrc file).

I wasted a while looking at it trying to work out how it did anything if there was a .nvmrc file, because obviously the `if` didn't match and I couldn't see the `elif` branch.
2021-11-22 14:34:43 +00:00
Ian Grayson
e9b26938b9 [readme] Describe another failure case for installing node versions from source on mac arm64 machines.
It seems to be related to https://github.com/nodejs/node/issues/39313 (which describes a similar issue).
2021-11-15 04:23:42 -08:00
Jordan Harband
ccd98f7fcb [Dev Deps] update doctoc 2021-11-19 08:59:37 -08:00
Jordan Harband
2f40eeef2e [shellcheck] apply v0.8.0 updates 2021-11-19 08:53:43 -08:00
Nix
c9e7bb2da1 [Fix] install script: Add --no-pager option to git branch 2021-10-23 22:23:55 +09:00
Wu Jiang
a284af9228 [New] Add OpenBSD support 2016-04-14 20:57:10 -04:00
Jordan Harband
5b3d188b83 v0.39.0 2021-10-07 10:11:35 -07:00
Jordan Harband
e8f485bb63 [Dev Deps] update doctoc, markdown-link-check 2021-10-07 10:08:53 -07:00
Simon East
055af09d24 [readme] link "Windows WSL" down to the "important notes" section 2021-05-04 15:56:53 +10:00
Matteo De Wint
93e0070a44 [Fix] nvm_die_on_prefix: filter prefixed env vars on name only, ignoring values 2020-11-28 15:16:35 +01:00
Felipe Alexandre Rodrigues
10189bf4cb [readme] Add bash_completion in "manual install" section 2021-10-05 10:47:56 -03:00
Jordan Harband
da5baa005b [Tests] use a matrix on the nvm install-latest-npm tests 2021-10-05 16:14:05 -07:00
Jordan Harband
ebbd30eb7f [Fix] nvm install-latest-npm: ensure npm 8 does not install on unsupported nodes 2021-10-05 15:13:45 -07:00
Rick Button
2bda9fd97e [Tests] blacklist expired LetsEncrypt CA
workaround for TravisCI's ubuntu 16.04
2021-10-06 01:50:44 -04:00
Peter Dave Hello
7b530edd3a [Docs] Use absolute URL for #606 in README.md
Since markdown-link-check hasn't support relative links, to make the
test passed, move this link to use absolute URL so that we can introduce
the new test. cc tcort/markdown-link-check#10
2017-11-05 04:07:37 +08:00
Peter Dave Hello
1afd4f3566 [Tests] Add markdown-link-check script
This uses the npm package `markdown-link-check` to check if all the links in the documentation are alive.
2017-11-05 04:06:36 +08:00
Kaito Udagawa
53f9ba8336 [Refactor] Use awk for path stripping
This works with paths which contains regex meta characters.
2016-12-23 01:03:41 +09:00
Jordan Harband
07c02d43fe [Tests] nvm install-latest-npm: node < 0.10 breaks with npm with dropped support for TLS < 1.2 2021-09-29 10:47:34 -07:00
Alister Norris
59b0b3942c [readme] Add quick intro to nvm
Allow newbies to get a quick understanding of how `nvm` works right from the start.
2016-12-06 15:14:08 +00:00
Peter Dave Hello
7bbc57355d [Tests] Print shell version in Travis CI 2017-04-02 07:33:49 +08:00
Alex Sabau
47f0b32155 [readme] Add info to restart bash if verification not working in verification section 2018-02-25 21:46:31 +01:00
James Stroud
91bd22aa57 [readme] fixed small typo afew to a few
also gave more up to date versions for example of  `nvm install` and `nvm which` as well as your pointer section
I love your project by the way.
2021-06-04 15:15:17 -04:00
Tim Connolly
ca897ac6d5 [readme] Avoid infinite loop in cdnvm() 2021-09-22 16:25:28 +10:00
Axel Svensson
11d71ab24b [Fix] Regression in 2dad045
Fixes #2599
2021-09-24 01:56:47 +02:00
Georgi Chochov
4471b6beb6 [readme] remove duplicate word 'run' 2021-09-26 09:47:50 +00:00
Nikita N
cc6915e216 [readme] updated automatic call script for bash
Bash terminal was throwing error: `bash: cd: too many arguments` when directory had some spaces in the name.
The quotes around `$PWD` fixes this issue
2021-09-21 23:57:25 +03:00
Jordan Harband
b6b6e685a3 [Fix] set -a: when this option is set, some sh shells break
Fixes #2574
2021-09-14 23:26:31 -07:00
Gilad Barnea
d91087c333 [Fix] bash_completion: be robust when cd is overridden 2021-09-13 15:26:40 +03:00
Step Security
59532c74c6 [actions] restrict permissions for GITHUB_TOKEN 2021-09-10 06:09:45 +00:00
Jordan Harband
2dad0455ec [Fix] nvm_die_on_prefix: avoid grepping env functions in bash
ironically, nvm itself has functions that matched this grep.
2021-09-08 23:49:16 -07:00
Jordan Harband
f03f69508e [Fix] reinstall-packages: handle global symlink locations properly
This is a regression caused by npm ls -g in npm 7 no longer returning absolute paths.
2021-09-07 10:14:18 -07:00
Jordan Harband
fa63399991 [Tests] postcss v7.0.36 stopped working on node 0.10; downgrade to v4 2021-09-09 00:05:09 -07:00
Kevin Stolp
291c7c4c47 [Fix] nvm_ls_remote_index_tab: handle long version lists 2021-09-03 23:40:13 -07:00
Jordan Harband
c169d622ff [Tests] update mocks 2021-09-04 08:57:36 -07:00
Jordan Harband
5b77f7d023 [Fix] nvm ls/nvm alias/nvm_list_aliases: zsh: when no LTS aliases, no error
Fixes #2575.
2021-09-01 10:06:32 -07:00
Jordan Harband
fd78c0101e [Tests] disable fail-fast 2021-08-31 15:28:41 -07:00
Peter Dave Hello
678a827978 [Dockerfile] Update dated base image from Ubuntu 16.04 to 18.04 2021-08-31 02:03:30 +08:00
IYaksha
62d45af17e [readme] fix typo regarding docker image base in Dockerfile 2021-08-30 19:20:03 +05:30
Jordan Harband
e0df5e92e3 [Robustness] avoid IFS shenanigans: quote arg count/return codes 2021-08-24 09:34:01 -07:00
Thomas Geirhovd
e98e9d9e4b [Fix] install: Detect correct profile based on $SHELL var 2021-08-12 15:51:32 +02:00
Jordan Harband
812d6e4ab4 [actions] fix typo in dockerfile_lint job 2021-08-05 08:35:22 -07:00
Jordan Harband
7f2ccd51d4 [Fix] nvm_get_arch: suppress error output if /sbin does not exist
Introduced by #2469
2021-08-05 08:05:54 -07:00
Jordan Harband
7ba49f8f71 [actions] use node/install instead of node/run 2021-07-27 22:23:56 -07:00
Jordan Harband
eed0d0e85c [meta] add project charter and governance 2021-04-26 12:56:08 -07:00
Jordan Harband
ad24e96fda [shellcheck] disable additional -x warning from v0.7.2 2021-05-03 14:26:45 -07:00
Jordan Harband
b5165ecbe4 [shellcheck] update for new warnings in v0.7.2 2021-05-03 14:19:31 -07:00
Jordan Harband
fc87226b23 [readme] move License and Copyright notice sections to the bottom 2021-04-26 11:46:12 -07:00
Jordan Harband
f3caa06420 [meta] add OpenJS Foundation copyright notices/links 2021-04-26 11:42:03 -07:00
Jordan Harband
1527ac9d21 [readme] remove redundant "license" section text in favor of LICENSE.md 2021-04-26 11:41:29 -07:00
Jordan Harband
bd0ac1e96d [meta] add SECURITY.md 2021-04-22 22:28:41 -07:00
akefirad
117486d4a7 [Fix] bash_completion: check if compinit is called before calling it
Fixes #2489.
2021-04-16 18:53:35 +02:00
Jordan Harband
07253ecd51 [actions] adjust shellcheck/windows tests to9 have a final "done" job 2021-04-15 22:34:40 -07:00
nmarghetti
f2582275f6 [New] maybe support Windows with WSL, MSYS, Cygwin 2021-01-02 00:03:24 +01:00
nmarghetti
d118be8fd4 [Tests] Add unit tests for nvm_is_version_installed 2021-02-21 18:48:43 +01:00
Leandro Facchinetti
5fcec573eb [readme] Improve README about Macs with M1 chips
Mention that you must have Rosetta 2 installed and provide instructions on how to do it.
2021-04-05 16:25:41 +01:00
Botspot
779a34e6a9 [Fix] nvm_get_arch: Rasbperry Pi: armv7l with arm64 kernel, get correct arch
Co-authored-by: Botspot <54716352+Botspot@users.noreply.github.com>
Co-authored-by: Jordan Harband <ljharb@gmail.com>
Co-authored-by: Sladyn Nunes <sladynnunes98@gmail.com>
2021-03-22 14:56:25 -05:00
Sladyn Nunes
2b5e53fcd5 [Fix] install script: check the proper version; fetch tags also
Co-authored-by: Sladyn Nunes <sladynnunes98@gmail.com>
Co-authored-by: Jordan Harband <ljharb@gmail.com>
2021-04-01 19:06:40 +05:30
Jordan Harband
f534fde760 [Tests] node-gyp v8 breaks this test 2021-04-06 12:36:07 -07:00
Jordan Harband
3fea5493a4 v0.38.0 2021-03-29 12:49:10 -07:00
Jordan Harband
cfc7edac65 [Dev Deps] update dockerfile_lint, eclint, replace, semver 2021-03-29 12:49:02 -07:00
Jonathan Perret
c26bd935c0 [readme] M1 macs: Add nvm use command to clarify that it is required 2021-03-24 10:50:38 +01:00
Jonathan Perret
621ccc5d13 Clarify the M1 shell instructions
The instructions seemed to encourage the misconception that `arch -x86_64 zsh` somehow modifies the default architecture for `zsh`, an operation which would need to be "reverted".
In fact, `arch -x86_64 …` merely spawns a new process under the selected architecture.
2021-03-23 14:37:04 +01:00
Andrew Shield
b19d8dbbba [readme] Update source command to include s in zsh 2021-03-18 16:07:24 +13:00
Jordan Harband
0579718308 [Fix] install script: define nvm_echo
- refactor `echo` to use `nvm_echo`

Per 589c2377fb (r48360520)
2021-03-17 09:07:15 -07:00
Marcin Kłopotek
8884fd32f6 [readme] Add nvs as one of the Windows alternatives
Co-authored-by: Jordan Harband <ljharb@gmail.com>
2021-03-01 13:28:09 +01:00
Sladyn Nunes
25d2ebf2f8 [readme] add headings to certain sections
Fixes #2413.
2021-03-03 20:47:44 +05:30
Jordan Harband
9cb6a2b614 [Tests] ensure doctoc action fails when it should 2021-03-17 08:11:37 -07:00
artforlife
216ccd62f7 [readme] add commands to help troubleshoot without closing the current shell
Co-authored-by: artforlife <artforlife@users.noreply.github.com>
Co-authored-by: Sladyn Nunes <sladynnunes98@gmail.com>
2020-04-26 12:57:50 -05:00
Rodrigo Espinosa de los Monteros
4da7f101a2 [Fix] nvm_alias: ensure lts/-1 returns the one before lts/*
Fixes #2461
2021-03-11 16:22:31 -05:00
Jordan Harband
641f86879f [Tests] update mocks
- make call count test depend on mocks
2021-03-11 13:06:41 -08:00
Lukman
1081ed161b [New] install: add parallel build support for openbsd
Co-authored-by: Lukman <lukmaan.me@gmail.com>
Co-authored-by: Sladyn Nunes <sladynnunes98@gmail.com>
2020-12-26 22:23:35 +05:30
Vesa Vilhonen
52f67b3677 [Fix] exec: -- should stop argument parsing
Co-authored-by: Vesa Vilhonen <vesa@vilhonen.com>
Co-authored-by: Sladyn Nunes <sladynnunes98@gmail.com>
2020-11-20 13:06:28 +02:00
Sladyn Nunes
4fdef427e4 [New] install: add -b flag to skip building from source
Fixes #2114.
2021-02-16 19:34:23 +05:30
farmer
d9b11ba208 [readme] update cdnvm implementation 2021-02-19 21:12:03 +08:00
Jordan Harband
87f37909f2 [meta] add CODE_OF_CONDUCT.md 2021-02-15 14:33:44 -08:00
nmarghetti
7f6c0c053a [Refactor] add nvm_install_binary_extract 2021-01-02 00:03:24 +01:00
nmarghetti
d396181ffb [Refactor] add nvm_get_artifact_compression 2021-01-02 00:03:24 +01:00
shiyutim
a5742d4e9e [readme] add install error tips 2021-01-07 10:51:33 +08:00
David Zulaica
d5c1441a83 [readme] Update M1 macOS troubleshooting instructions 2021-02-13 03:41:41 -08:00
Arshath
0fad5ec575 [readme] quote asterisk in shell command on --latest-npm example 2021-02-05 19:45:26 +05:30
Jordan Harband
0d14d7f6b7 [Dev Deps] update doctoc, replace, semver 2021-02-01 14:31:06 -08:00
Jordan Harband
4c11ab1ac6 [actions] update workflows 2021-02-01 14:39:36 -08:00
Matt Calthrop
49e806c77a [readme] Add macOS troubleshooting instructions for M1 chip 2021-01-21 20:45:12 +00:00
Brandon L. Reiss
3243f7a082 [Fix] Fix potential unbound var error on nvm install
Fixes #2420. When using `nvm install` with an already installed
version, Bash (and potentially other shells) may emit an unbound
variable error when `set -u` is set. The presence of the error depends
on specific shell versions, but appears to happen in MacOS 11.1 (Big
Sur) using a recent Bash version installed via Homebrew (as of this
writing).

The fix accesses `ALIAS` correctly for the case where it is not set by
an `alias` option to `nvm install`.
2021-01-27 13:12:17 -05:00
Jordan Harband
015623ee6d [Fix] avoid parse error with common omz global aliases, in nvm_print_color_code
Merge pull request #2365 from hosamaly/patch-1
2021-01-20 13:47:17 -08:00
nmarghetti
502089ae30 [New] install script: Allow installation from other repository also for git method 2021-01-14 00:10:19 +01:00
nmarghetti
589c2377fb [Fix] install script: sync nvm_download implementation from nvm.sh 2021-01-13 02:26:38 +01:00
nmarghetti
60e78d3ec1 [Tests] Add unit test for nvm_download 2021-01-13 02:26:38 +01:00
nmarghetti
9f3397afa4 [Tests] add nvm_grep to install script, fix tests 2021-01-08 18:54:40 +01:00
Jordan Harband
436cda247e [Fix] remove nvm_supports_source_options
Fixes #2387
2021-01-07 13:00:26 -08:00
nmarghetti
9849bf494d [meta] Rename some files to be more cross platform 2021-01-04 00:49:05 +01:00
nmarghetti
4e9df33cb7 [New] install script: Allow installation from other repository 2020-12-27 10:09:29 +01:00
hjoshi123
f3fa157456 [Fix] bash_completion: move compinit before bashcompinit 2020-12-29 08:35:08 +05:30
hjoshi123
6982dee071 [Docs]: Updated README.md to include homebrew unsecure dirs warning
Closes #2361.
2020-12-22 17:29:32 +05:30
Hosam Aly
31c5c5c45a [Fix] avoid parse error with common omz global aliases, in nvm_print_color_code
Fixes #2362. Fixes #2372.
2020-11-27 23:17:07 +00:00
Dena Burd
2fea55fdb5 [Tests] add test that fails without fix for #2362 2021-01-15 14:07:47 -08:00
Shiming
10399ed1bd [Docs] source ./nvm.sh instead of nvm.sh, for zsh
Fixes #2204.
2020-04-27 16:11:09 +08:00
Jordan Harband
3c079f16c7 [shellcheck] fix silly shellcheck complaint 2020-12-21 23:47:25 -08:00
Jordan Harband
e76b2945c5 [Fix] relax $PREFIX checking, to accomodate npm exec
Fixes #2379.
2020-12-21 23:03:30 -08:00
Rui Chen
e48cb858a6 [Tests] .npm is now cached by default 2019-10-02 15:05:36 -04:00
Keith Lazuka
86708833c9 [Fix] Use local variable when looping over args
When the `nvm` function is called by a script which itself uses a variable
named `i`, `nvm` clobbers the caller's variable. This happens even if the
caller has declared its variable as local.

See note 1 on https://tldp.org/LDP/abs/html/localvar.html#FTN.AEN18568
2020-12-08 12:28:24 -05:00
David Moles
d4eba354b5 [Fix] install: Ignore npm command under $NVM_DIR when checking for global modules 2020-11-30 15:22:24 -08:00
Jordan Harband
ed321f1df0 [Tests] release: clobber local tags 2020-11-27 21:44:33 -08:00
Jordan Harband
4b947ec92d v0.37.2 2020-11-27 21:34:28 -08:00
Jordan Harband
3b57dfec8d Revert "[Fix] nvm_die_on_prefix: only grep lines starting with env var name" (#2347)
This reverts commit 21c0c05130.

Fixes #2360. Fixes #2364. Fixes #2366.
2020-11-27 21:28:12 -08:00
Jordan Harband
661a702cdd v0.37.1 2020-11-24 21:16:43 -08:00
Jordan Harband
510b2fd44c [Tests] fix eclint errors 2020-11-21 18:08:22 -08:00
Jordan Harband
80a4e06af9 [Tests] partially migrate to Github Actions 2020-11-07 00:09:08 -08:00
Alex Aubuchon
22902f04a3 [actions] Add release test workflow 2020-11-20 14:28:15 -05:00
Dena Burd
6848c16d53 [New] Added set-colors command. See details below:
This command allows users to replace default colors with their own custom colors.

 - top-level commands modified: alias, ls, ls-remote
 - helper functions added: nvm_echo_with_colors, nvm_err_with_colors,
nvm_set_colors, nvm_get_colors, nvm_print_color_code
 - functions modified: nvm_print_formatted_alias, nvm_print_versions, nvm_print_alias_path (implicitly), nvm_print_default_alias (implicitly), nvm_list_aliases (implicitly)

We added tests and info on using this command to the README!

Co-authored-by: Dena Burd <29719099+gitburd@users.noreply.github.com>
Co-authored-by: Naomi Quinones <52065567+naomiquinones@users.noreply.github.com>
2020-08-17 14:56:13 -07:00
Alex Aubuchon
3abb98124e [actions] Add shellcheck workflow
Co-authored-by: Alex Aubuchon <alex@aub.dev>
Co-authored-by: Jordan Harband <ljharb@gmail.com>
2020-11-18 12:49:28 -05:00
Matteo De Wint
21c0c05130 [Fix] nvm_die_on_prefix: only grep lines starting with env var name 2020-11-16 11:35:26 +01:00
Alex Aubuchon
00af6341f7 [Tests] Run fast test suite in clean environment 2020-11-03 19:05:34 -05:00
Jordan Harband
11a9d22607 [actions] add "Allow Edits" workflow 2020-11-06 23:56:55 -08:00
Jordan Harband
bbe032fa7e [actions] switch Automatic Rebase workflow to pull_request_target event 2020-11-06 23:55:52 -08:00
Jordan Harband
4054bd70ce v0.37.0 2020-11-06 10:11:29 -08:00
Jordan Harband
499d303746 [Perf] use/nvm_die_on_prefix: replicate npm config algorithm and remove npm config call 2020-08-24 22:44:25 -07:00
Peter Dave Hello
31bc0a13c2 [Dockerfile] Clean up dated comment 2020-11-03 17:19:03 +08:00
Dena Burd
c72f2c6f21 [Fix] nvm ls-remote: accept versions that end with a dot
Fixes #983.
2020-09-24 13:46:29 -07:00
Alex Aubuchon
f2c5ce459a [Tests] Fix nvm unload fast test cleanup 2020-10-22 20:43:36 -07:00
Jordan Harband
0f0d5e8270 [dev deps] alphabetize dependencies 2020-10-22 20:41:45 -07:00
Alex Aubuchon
e77ed07ccc [Tests] Fix nvm_ls_current fast test 2020-10-13 12:32:41 -04:00
Dylan Armstrong
e01060fa2c [Fix] nvm_die_on_prefix: use directory comparison rather than string 2020-10-09 09:43:21 -05:00
Dylan Armstrong
96069da0d5 [Fix] nvm_ls: zsh: unset markdirs and local_options
Fixes #2315.
2020-10-09 09:43:21 -05:00
Peter Dave Hello
4436638816 [Tests] Drop deprecated sudo: option in TravisCI config
That config was deprecated for a while, reference:
- https://blog.travis-ci.com/2018-10-04-combining-linux-infrastructures
2020-09-21 20:28:09 +08:00
Matthieu Bosquet
344cc32ac3 [readme] bash shell integration: Amended example to call cd when booting a terminal (previously only called on cd).
It means that works with for example VS Code's integrated terminal.
2020-10-05 17:30:03 +01:00
Jordan Harband
7929190e6e [Docs] improve nvm --help output
Fixes #2301
2020-10-02 22:22:12 -07:00
Jordan Harband
8debf39f24 v0.36.0 2020-09-23 16:18:37 -07:00
Jordan Harband
c7ca08d575 [Fix] latest-npm: ensure npm 7 is not installed on node < 10 2020-09-23 14:50:33 -07:00
Peter Dave Hello
6110d31969 [dockerfile] Add missing apt pacakge locales
locale-gen command seems missing since uncertain point for a while:

```
Step 15/33 : RUN locale-gen en_US.UTF-8
 ---> Running in fae073c89c01
 /bin/bash: locale-gen: command not found
 The command '/bin/bash -o pipefail -c locale-gen en_US.UTF-8' returned
 a non-zero code: 127
```

This patch should fix the Docker image build
2020-09-21 18:20:50 +08:00
Peter Dave Hello
68d2f47c0a [dockerfile] Update ShellCheck download URL in Dockerfile
see koalaman/shellcheck#1871
2020-09-21 09:36:30 +08:00
Jordan Harband
6e0562ac6d [Tests] pin postcss to v7 2020-09-21 15:40:41 -07:00
Peter Dave Hello
68d331a816 [dockerfile] Remove ShellCheck Segmentation fault workaround
The workaround came from this GitHub issue comment:
https://github.com/koalaman/shellcheck/issues/1053#issuecomment-357816927

Looks like the problem doesn't exist any more:

```
.
.
.
Step 14/33 : RUN shellcheck -V
 ---> Running in 4b7a718c1cbf
ShellCheck - shell script analysis tool
version: 0.7.0
license: GNU General Public License, version 3
website: https://www.shellcheck.net
.
.
.
```

The workaround should be removed so that the Dockerfile will be easier
to be understand and read.
2020-09-21 02:47:57 +08:00
Saikat Das
22e07cc0c1 [readme] fix LTS upgrade command
Edited the LTS upgrade scenario command to fix the issue discussed in #2271
2020-08-27 19:27:29 +05:30
Jordan Harband
cf92956e5d [New] add nvm_find_project_dir helper 2020-08-23 14:40:42 -07:00
Jordan Harband
1d88ecfce5 [Fix] nvm_die_on_prefix: check that the prefix is inside the version dir, not just the nvm dir
- also pass the version dir as the third argument
2020-08-23 22:50:41 -07:00
Jordan Harband
035bf9e28e [readme] update autocompletion output examples 2020-08-23 23:29:48 -07:00
Michael Potter
f7fbad2bd6 [performance] nvm_auto: only call nvm_ls_current in use mode 2020-08-19 11:40:45 -07:00
Steve Lee
19c55b9936 [readme] Mention problem with windows cmd echo 2020-08-11 18:39:32 +01:00
Jordan Harband
9dc6f3e4a5 [Refactor] nvm run/nvm exec: use NVM_SILENT consistently internally 2020-08-13 14:37:41 -07:00
Jordan Harband
1c00753fd9 [New] nvm deactivate/nvm which: add --silent 2020-08-13 13:40:32 -07:00
Yash-Singh1
b1200c659b [Fix] nvm use: fix --silent when version is omitted
Fixed a bug where --silent mode was failing for nvm use I ran a test
 that just ran ```nvm use node --silent``` that I wrote by myself.
 Unfortunately I noticed a bug where it still prints out some messages in
 different cases. This pull request is to fix that bug. * Added in an argument
 called ***quiet***  to the nvm_rc_version() function at *line 339* * Printed
 anything inside the nvm_rc_version() only in the scenario where quiet mode is
 off * Ran the nvm_rc_version() function in quiet mode only if silent mode is
 on in the "use" command of nvm at *line 2990* * Ran *nvm_echo* and *nvm_err*
 inside the "use" command of nvm only in the scenario where silent mode is off
 (There were 4 scenarios where this was forgotten) * Edited the ```nvm
 deactivate``` command to include a silent mode * Changed the help page to
 include the --silent option for ```nvm deactivate``` * Added in aliases for
 the --silent flag in ```nvm deactivate``` and ```nvm use``` * Used silent
 mode inside the ```nvm use``` when running ```nvm deactivate``` inside it and
 silent mode is on A test was attached in the 'test/slow/nvm use' directory.
 It is named *Running "nvm use node --silent" doesn't print anything*. It runs
 ```nvm use node --silent and checks``` and succeeds if the OUTPUT matches the
 EXPECTED_OUTPUT which is *null*  or *''*. When the test was run locally, it
 still ouputed results if someone deleted some contents of the *.nvm/* folder.
 This output was given from the ```nvm deactivate command```. This was the
 reason that the ```nvm deactivate``` was edited to include silent mode.
2020-08-08 17:27:46 -07:00
Jordan Harband
16b75b7333 [Robustness] add command to xargs/rm in nvm_get_default_packages
Fixes #2281.
2020-08-11 10:16:42 -07:00
Naomi Quinones
1bf567bd0b [Fix] ensure --help is intercepted on any command
Co-authored-by: Naomi Quinones <52065567+naomiquinones@users.noreply.github.com>
Co-authored-by: Dena Burd <me@Denas-MacBook-Air.local>
2020-08-04 16:32:19 -07:00
Dimitris Karagiannis
a01deb11dc [patch] Update docs and add warning for 'nvm is not compatible with the npm config "prefix" option' edgecase error on Mac OS 2020-08-03 10:04:20 -07:00
Kayla Altepeter
a5aec107df [New] adding default and alias option to nvm install
For: `nvm install 8.12.0` after install:

--alias=8 is equivalent to `nvm alias 8 8.12.0`
--default is equivalent to `nvm alias default 8.12.0`

Co-authored-by: Kayla Altepeter <kayla@kaylaaltepeter.com>
Co-authored-by: Dena Burd <me@Denas-MacBook-Air.local>
Co-authored-by: Jordan Harband <ljharb@gmail.com>
2018-10-22 08:32:29 -05:00
Saikat Das
18c6f98acc [readme] Add documentation for LTS updates which reinstall existing packages
Added an example for LTS updates that also reinstall the existing packages.
This is useful for individuals who run the latest LTS version along with global packages and need to update when the LTS version gets bumped
2020-07-28 19:31:30 +05:30
Jordan Harband
424aeb38b4 [Refactor] add nvm_get_checksum_binary; use it in nvm debug 2020-07-31 22:13:21 -07:00
Jordan Harband
abfe0a5891 [Refactor] remove unused nvm_checksum function 2020-07-31 22:10:28 -07:00
Naomi Quinones
3561bbc54a [Fix] --help: Add more examples
Fixes #2120.
2020-07-28 17:56:48 -07:00
Jordan Harband
83043c4d3a [debug] add whoami output 2020-07-25 13:38:52 -07:00
Dena Burd
55eafcd814 [New] add nvm -v as an alias for nvm --version
Fixes #2200.
2020-07-27 10:26:35 -07:00
ritmos
06c3bf6a8f [Docs] --help: explain more clearly that <version> parameter is optional and can be provided by .nvmrc on nvm install, nvm use, nvm exec, and nvm run. 2020-06-20 15:15:01 +02:00
DeeDeeG
4b1100e515 [New] nvm_supports_xz: Add Mac/FreeBSD xz platform support checks
macOS only supports extracting xz tarballs with `tar` in 10.9 and up.

GNU tar needs an `xz` executable on the `PATH` to extract xz tarballs.

(These are the most common variants of tar, so until further testing
is done, conservatively assume all variants of tar (other than the one
shipped with macOS) need an xz executable on the PATH in order to
decompress xz tarballs.)

Fixes #2155.
2020-01-29 16:20:15 -05:00
Bram Wubs
f6d11bae41 [readme] Fix fish load_nvm function 2020-07-07 08:29:00 +02:00
Marcus Kazmierczak
d2d232ea2b [readme] Update macOS troubleshooting w/ 10.15 zsh default
The default shell for macOS 10.15 is now zsh, by default a .zshrc file
is not created, so switch instruction for touch ~/.zshrc
2020-06-24 11:02:01 -07:00
Connor Leech
7b3af45cf7 [readme] Update install instructions troubleshooting
This is in response to a popular stack overflow answer that has helped people resolve the "command not found" hiccup: https://stackoverflow.com/a/17707224/2031033

Also mentioned here: https://github.com/nvm-sh/nvm/issues/748
2020-05-25 07:36:40 -07:00
Peter Dave Hello
bac5393e12 [Docs] Syntax highlight for Ansible task example in README.md 2020-05-29 21:01:47 +08:00
Szymon Dzialowski
2d4e877b61 [readme] Stop removing spaces from nvm_path
It breaks switching version of node through nvm in directories with space somewhere in it's path.
2020-06-10 18:28:14 +01:00
Jordan Harband
6575b6b052 [Fix] install: improved arg parsing around --reinstall-packages-from
Fixes #1762
2020-06-04 16:15:39 -07:00
Bruce A. MacNaughton
33fa27dabe [Docs] Update README for environment variables 2020-02-07 12:01:57 -08:00
Sehrope Sarkuni
91a55dd91a [Refactor] Rename solaris and iojs helper functions to be nvm_ prefixed
Renames node_version_has_solaris_binary and nvm_iojs_version_has_solaris_binary
to be prefixed with nvm_ so they do not show up in tab completion following the
word "node".
2020-05-08 16:08:27 -04:00
Jordan Harband
7aba64a2d5 [meta] further TOC action tweaks 2020-04-29 20:18:40 -07:00
Jared Ramirez
dcc8059ef8 [readme] include deeper integration instructions for fish 2020-04-29 15:25:23 -07:00
Jordan Harband
8e1e5df059 [meta] fix TOC action 2020-04-29 15:13:30 -07:00
Jordan Harband
e0ed1eacfd [meta] add actions: Automatic Rebase for PRs, auto-update-TOC for push 2020-04-29 12:06:01 -07:00
Peter Dave Hello
73438e339e Update Dockerfile base image to Ubuntu 16.04, cc #2008 2020-03-30 02:17:28 +08:00
Magnus Markling
b02617028f [Tests] Source nvm.sh before defining FILE 2020-03-19 12:13:29 +01:00
Jordan Harband
f607f2f783 [Fix] reinstall-packages: do not include unmet peer deps
Closes #1948.
2020-03-10 23:51:17 -07:00
Jordan Harband
258938ef66 v0.35.3 2020-03-05 23:13:56 -08:00
Jordan Harband
096ba0d8c3 uninstall: add NVM_DEBUG to print out a filename as its permissions are checked 2020-03-05 17:40:17 -08:00
Jordan Harband
4626d1aae6 [New] add lts/-1 etc, to point to an LTS line relative to "latest" 2020-03-04 01:03:36 -08:00
Jordan Harband
c372ff03e0 [Tests] update mocks 2020-03-04 00:44:35 -08:00
Jordan Harband
30cd9c5dc8 [Tests] fix update mocks script 2020-03-04 00:57:58 -08:00
Jordan Harband
b9536327ae [Fix] nvm ls-remote: properly label latest LTS versions instead of just the latest one in the filter
Fixes #2166
2020-02-21 21:27:13 -08:00
Jordan Harband
e609091a55 [Tests] update test mocks 2020-02-22 09:06:59 -08:00
flip111
8093dbeacd [readme] add nvm intro
Closes #2149.
2020-01-23 20:32:07 +01:00
Jordan Harband
4cd6b4822c [Tests] try to make nvm unload test more robust 2020-02-09 06:41:52 -10:00
Bruce A. MacNaughton
6c560b12b6 [New] use: set NVM_INC to expose the node include path 2020-02-07 06:23:35 -08:00
Jordan Harband
f4eddb2c9c [Tests] ensure nvm unload unsets env vars too 2020-02-07 09:16:55 -10:00
Jordan Harband
a1ad32e9cb [readme] restore broken anchor 2020-01-11 18:15:20 -08:00
nebbles
d8785da988 [Docs] Improve readme clarity and troubleshooting
Clean up readme structure a bit to help with readability. fix
instructions which could lead to a sourcing loop if misinterpreted.
guidance should direct macos users to simply copy the source snippet
manually into their desired profile file.

Resolve #2123
2019-11-17 14:52:52 +00:00
Lucian Buzzo
4ff9084e99 [Docs] Fix small typo in README 2019-12-05 10:07:38 +00:00
Jordan Harband
f355b327d6 v0.35.2 2019-12-17 22:40:20 -08:00
Jordan Harband
6fa92c82ca [Fix] if a prefix env var is set (as in npm run), but is correct, do not fail
Fixes #2106.
2019-12-15 23:39:32 -08:00
Jordan Harband
0899839b95 [Tests] pin david to v11
v11.1.0 and v12 no longer work on node 0.10; v11.1.1 should.

See https://github.com/alanshaw/david/issues/159
2019-12-09 08:51:46 -08:00
Jordan Harband
73a513c389 [Fix] allow nvm unalias x when x is a default alias, but shadowed
Fixes #2122.
2019-11-12 11:16:08 -08:00
awthwathje
04ad1b528c [readme] Fix a typo 2019-11-08 10:24:16 +01:00
Jordan Harband
1c8e59130f [meta] create FUNDING.yml 2019-11-05 12:05:09 -08:00
Jordan Harband
28bc2fd991 v0.35.1 2019-11-03 10:03:31 -08:00
Jordan Harband
100861d529 [Fix] install-latest-npm: npm v6.10 breaks on node v6.0, v6.1, and v9.0-v9.2 2019-11-02 20:53:18 -07:00
Marit Iren
1eca354233 [Docs] Add description if instructions don't work; make install instructions more readable 2019-10-20 17:08:29 +02:00
Guido Bouman
0a4e6f2b70 [meta] Update ISSUE_TEMPLATE.md
Remove the need to indent terminal output by using headings instead of a list.
Simplify formulation of steps
2019-10-08 15:27:53 +02:00
Jordan Harband
94a72ae217 [Fix] nvm use: improve help output with bare nvm use and no .nvmrc
Closes #1914.
2019-10-08 14:40:17 -07:00
Jordan Harband
011810e721 v0.35.0 2019-10-02 00:05:28 -04:00
Darío Hereñú
d48abff659 [Docs] clean up formatting in readme 2019-05-03 19:44:21 -03:00
Darío Hereñú
82037b41b1 [Docs] clean up a bit 2017-10-06 01:54:07 -03:00
Roman Isko
7b0a46eafb [docker] add libssl-dev to Docker image 2018-06-18 10:33:12 +03:00
Roman Isko
dcbecbf2c7 [shellcheck] install shellcheck v0.6.0 in Dockerfile 2018-06-14 10:45:01 +03:00
metasean
970cadf258 [Docs] Add --latest-npm info to Migrating global packages section
Adds the following information to the "Migrating global packages while installing" section:
- notification that the npm package is explicitly not updated when using the --reinstall-packages-from flag
- information about the --latest-npm flag
- recovery instructions if a user has already updated node with an incompatible npm version
2018-12-30 18:24:29 -07:00
Will Papper
3cc9525dce [Docs] [Fix] Set $NVM_DIR to ".nvm" instead of "nvm"
- Operating system and version: Mac OS X Mojave

- What happened? $NVM_DIR was set to nvm

- What did you expect to happen? $NVM_DIR should be set to .nvm
I added the following line from the README to my .zshrc:
```
export NVM_DIR="${XDG_CONFIG_HOME/:-$HOME/.}nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
```

I couldn't figure out why nvm wasn't loading, until I realized that
`echo NVM_DIR="${XDG_CONFIG_HOME/:-$HOME/.}nvm"` outputs `NVM_DIR=nvm`.

Changing the line to `export NVM_DIR="${XDG_CONFIG_HOME/:-$HOME/}.nvm"` fixed the problem. This outputs `NVM_DIR=.nvm` as expected. I tested this and the same behavior holds true in Bash as well.
2019-04-24 00:03:01 -07:00
Greg Smith
6537c91eb5 Fix bash auto-use nvm command
It was trying to read ./.nvmrc if you cd'ed into a subdirectory of the directory that has .nvmrc, which would give print `-bash: ./.nvmrc: No such file or directory` to stderr and potentially not doing the `nvm install`.
2019-08-09 14:38:37 -06:00
Jordan Harband
07b20d5008 [meta] add copyright line to license file 2019-07-17 10:48:23 -07:00
Sehrope Sarkuni
0b5bb5ccd8 [Fix] set -u: Add default empty value for $NVM_NO_ALIAS
Adds a default value for NVM_NO_ALIAS so that nvm ls does not error out when run
in a bash nounset/-u (no unset vars) environment.
2019-05-14 08:31:24 -04:00
Bastian Fuchs
45c1b84794 [Fix] Determine correct sub directory if XDG_CONFIG_HOME is set
With the environment variable XDG_CONFIG_HOME set, the installation
script uses the directory $XDG_CONFIG_HOME/nvm now. Before the change
the variable's value with "/nvm" cut off was used, which usually results
in an installation without any subdirectory.
2019-04-28 12:51:15 +02:00
Alfred Myers
3664744e3b Updated note about Windows
There's a lot of old info around the interwebs.
Much stating nvm doesn't work in WSL.
2019-05-02 12:20:17 -03:00
Jordan Harband
ee9e56582e [Tests] jspm v2 beta started breaking tests; pin to < v2 2019-05-04 13:34:16 -07:00
Jordan Harband
e7a5b7992b [meta] update repo links to point to org 2019-04-24 16:08:34 -07:00
Daniel Li
ff77ac17af [Docs] update bash cdnvm script to properly handle aliases
- Only works for common aliases like `default`, `system`, `node`, `lts/*`, `iojs` etc.
 - Prevent unnecessary running of `nvm use`
2019-03-12 16:43:08 +00:00
Christopher Sahnwaldt
2410215b6a [Refactor] add nvm_stdout_is_terminal helper 2019-02-24 00:03:19 +01:00
Christopher Sahnwaldt
a1abfd1fe4 [Tests] use rimraf over rmdir in teardowns
- fix test 'Running "nvm ls" should display all installed versions.': only expect versions created by this test, but no versions created by other tests
2019-02-27 10:50:59 +01:00
Jordan Harband
43402df896 [Fix] nvm_supports_source_options: work around a bug in bash 3.2
See https://github.com/creationix/nvm/issues/1978#issuecomment-453480231

Fixes #1978.
2019-02-26 16:53:36 -08:00
Eric Lewis
1ede50cbae [Docs] Add note about what version of node new shells run with.
Fixes #2000
2019-02-22 10:04:13 -05:00
Jordan Harband
e0d87528f3 [shellcheck] remove unnecessary overrides 2019-02-24 23:04:13 -08:00
Refael Ackermann
924a175bd8 [Tests] update dist from trusty to xenial 2019-02-25 15:02:15 -05:00
Jordan Harband
9daf26f0a0 [Tests] nvm_command_info: make error output more helpful 2019-02-25 13:17:10 -08:00
Jordan Harband
226487d358 [Fix] install: error out when an argument has ---
Fixes #1915.
2019-02-25 00:13:50 -08:00
Jordan Harband
216c24fba0 [Docs] --help: consolidate some help output 2019-02-24 22:57:06 -08:00
Christopher Sahnwaldt
930507dbbc [Docs] README.md: mention --no-colors option 2019-02-23 09:53:56 +01:00
Jordan Harband
4c8ced736d [Docs] nvm --help: add --no-colors and --no-alias 2019-02-24 00:04:40 -08:00
Jarvis Mercer - Amir Mohammad Safari (AMSL)
1f7f0c2d81 [Docs] add version number to nvm —help output 2019-01-27 04:13:12 +03:30
Jarvis Mercer - Amir Mohammad Safari (AMSL)
41eb40821b [Docs] add “update” terminology to installation section 2019-01-26 01:00:43 +03:30
Jordan Harband
c6740f5a6e [New] nvm ls: add --no-alias to suppress alias output
Per https://github.com/creationix/nvm/issues/1792#issuecomment-466696504
2019-02-23 22:41:46 -08:00
Jordan Harband
04fdb2331b [Tests] nvm ls: ensure nvm alias is called 2019-02-23 22:22:18 -08:00
Jordan Harband
58d0933f72 [Fix] attempt to fix a bug in bash 3.2, fixed in 4.4, that improperly exits on -e in a test.
See https://gist.github.com/ljharb/6e70a79ac5fcf11a8b9de654a88642aa for details.
2019-02-23 22:21:46 -08:00
Jordan Harband
2a5d2c06ff [Tests] add more checks to make_fake_* helpers 2019-02-23 15:24:02 -08:00
Jordan Harband
2a513a1bc0 [Fix] nvm_ls: Reverts #1462 to fix io.js sorting.
<details>
<summary>Before this revert:</summary>

```sh
iojs-v3.3.1
iojs-v2.5.0
v0.6.21
v0.7.12
iojs-v1.8.4
v0.8.28
v0.9.12
v0.10.48
v0.11.16
v0.12.9
v0.12.18
v0.12.87
v4.9.1
v5.11.1
v5.12.0
v6.14.4
v6.16.0
v7.10.1
v8.6.0
v8.9.1
v8.10.0
v8.11.3
v8.11.4
v8.12.0
v8.13.0
v8.14.1
v8.15.0
v9.11.2
v10.0.0
v10.1.0
v10.2.1
v10.3.0
v10.4.1
v10.5.0
v10.6.0
v10.7.0
v10.8.0
v10.9.0
v10.10.0
v10.11.0
v10.12.0
v10.13.0
v10.14.2
v10.15.1
v11.0.0
v11.1.0
v11.2.0
v11.3.0
v11.4.0
v11.5.0
v11.6.0
v11.7.0
v11.8.0
v11.9.0
v11.10.0
```
</details>

<details>
<summary>After this revert:</summary>

```sh
v0.6.21
v0.7.12
v0.8.28
v0.9.12
v0.10.48
v0.11.16
v0.12.9
v0.12.18
v0.12.87
iojs-v1.8.4
iojs-v2.5.0
iojs-v3.3.1
v4.9.1
v5.11.1
v5.12.0
v6.14.4
v6.16.0
v7.10.1
v8.6.0
v8.9.1
v8.10.0
v8.11.3
v8.11.4
v8.12.0
v8.13.0
v8.14.1
v8.15.0
v9.11.2
v10.0.0
v10.1.0
v10.2.1
v10.3.0
v10.4.1
v10.5.0
v10.6.0
v10.7.0
v10.8.0
v10.9.0
v10.10.0
v10.11.0
v10.12.0
v10.13.0
v10.14.2
v10.15.1
v11.0.0
v11.1.0
v11.2.0
v11.3.0
v11.4.0
v11.5.0
v11.6.0
v11.7.0
v11.8.0
v11.9.0
v11.10.0
```
</details>

In other words, the sorting needs to happen *before* the `NVM_NODE_PREFIX` is removed.
2019-02-23 15:02:31 -08:00
Jordan Harband
48196d2436 [Tests] fix fake node versions 2019-02-23 14:47:49 -08:00
Jordan Harband
7f9220dbd8 [Fix] nvm ls: --no-colors: system: print an asterisk 2019-02-23 14:41:57 -08:00
jjangga0214
890fbb5581 Update README: sync node release schedule url 2019-02-15 11:11:01 +09:00
Jordan Harband
e1bb44f712 [shellcheck] add overrides 2019-02-04 14:45:04 -08:00
Jordan Harband
db19450caa [Fix] default_packages: work when the file lacks a trailing newline
Fixes #1995.
2019-02-02 13:45:11 -08:00
Jordan Harband
5c117e6ab3 [Refactor] extract “get default packages” logic to nvm_get_default_packages 2019-02-01 13:27:18 -08:00
Lucas Kellner
02997b0753 [Docs] unalias: add more specific error message for builtin aliases 2019-01-23 16:39:57 -08:00
Peter Dave Hello
cc0750eb5d [Fix] install: Add missing io.js installation message
Fixes #1988
2019-01-22 15:46:29 +08:00
Peter Dave Hello
7e715d5c73 [Tests] Improve syntax in "test/installation_iojs/nvm install v1 works" 2019-01-23 03:10:03 +08:00
Jordan Harband
66d2909650 Merge pull request #1986 from Sayegh7/master
[Fix] Make installation less restrictive when NVM_DIR is set
2019-01-22 10:50:10 -08:00
Jordan Harband
a56c6f1485 tweak logic 2019-01-21 21:58:43 -08:00
Ahmed El Sayegh
703babe60a [Fix] Make installation less restrictive when NVM_DIR is set 2019-01-21 02:15:02 +02:00
Peter Dave Hello
10f24d6d4b [Refactor] nvm.sh: make coding style more consistent 2018-05-22 20:57:40 +08:00
Peter Dave Hello
e367533eb8 [Refactor] Reduce one more sed & pipe to speedup 2017-03-28 23:15:35 +08:00
Peter Dave Hello
6534568745 [Fix] Enhance nvm debug for different environments 2019-01-12 14:17:01 +08:00
Waldir Pimenta
13f3cdcdf7 README: clarify how to specify default packages 2019-01-11 10:42:33 +00:00
Jordan Harband
3d9c31d944 v0.34.0 2019-01-07 23:01:16 -08:00
Jordan Harband
0acccb8a77 Merge pull request #1974 from valeriemettler/valeriemettler-patch-1
[Docs] Improve phrasing of 'nvm current'
2019-01-05 14:10:31 -08:00
Valerie Mettler
6354b170d7 Improve phrasing of 'nvm current'
To help beginners know that 'nvm current' is talking about node and not nvm.
2019-01-05 12:20:56 -08:00
Javier Infante
5e065ec026 [Docs] fixing cdnvm on .bashrc 2018-12-31 08:42:58 +01:00
Peter Dave Hello
206d503a21 [Docs] Improve indent of output block in GitHub Issue template 2018-12-26 03:46:13 +08:00
Jordan Harband
deb2a9b821 [Docs] fix eclint 2018-12-19 15:36:24 -08:00
Joel Parker Henderson
fb83eeb140 [Docs] Add Ansible task example
Add Ansible task example to show how to install nvm and update it.

Ansible is a systems administration tool.
See https://github.com/ansible/ansible

My personal experience of `nvm` is that installing via Ansible is good, and that a good example can help. This example took me about an hour to learn, so I'm hoping to save other people some time. This example is somewhat different than any others that I found on the web. There may be a better way to write it, and if so, please improve it.
2018-12-19 12:45:59 -08:00
Peter Dave Hello
14179bc8ce [shellcheck] Use -n/-z instead of ! -z/! -n condition
https://github.com/koalaman/shellcheck/wiki/SC2236
2018-12-03 13:59:19 +08:00
Jordan Harband
153506c8da [shellcheck] ignore SC2230 errors 2018-11-25 16:22:25 -08:00
Jordan Harband
c1150c41ab [Tests] avoid using shopt in zsh 2018-11-26 11:18:11 -08:00
Jordan Harband
ad1110ef1a [Tests] print out shellcheck version 2018-11-25 23:56:19 -08:00
Jordan Harband
914c220586 Merge pull request #1947 from PeterDaveHello/Enable-ccache-on-TravisCI
[Tests] Enable ccache on Travis CI to speed up compilation
2018-11-24 23:18:23 -06:00
Peter Dave Hello
22d32bede0 [New] Enable ccache on Travis CI to speed up compilation 2018-11-22 13:58:26 +08:00
Jordan Harband
a49d9163ef [Fix] avoid unbound variable
Fixes #1949.
2018-11-21 21:25:20 -06:00
Alexander Groß
17586b971a [Fix] Allow zsh users to have the nomatch option set
Closes #1937.
2018-11-08 00:55:52 +01:00
Peter Dave Hello
f3fd5eff46 [Docs] Improve md file syntax
- Lists should be surrounded by blank lines
- Use only `1.` for ordered list item prefix
- Starting bulleted lists at the beginning of the line
- Fenced code blocks should be surrounded by blank lines
2018-07-15 02:26:05 +08:00
Kayla Altepeter
423252a99c [docs] update README to fix docker run command flag order 2018-10-18 22:30:05 -05:00
Ole Johan Andersen
2a294ebd61 [Docs] improve instructions for manual install 2018-10-24 19:49:55 +02:00
Jordan Harband
a08d1ea4a3 Merge pull request #1865 from d4nyll/master
[Docs] Add section on automatic `nvm use` in Bash

Replaces #1108 and #1677. Closes #1678.
2018-11-05 16:10:15 -08:00
Fábio Antunes
217a5bb0de [Docs] Added fish nvm 2018-10-21 23:31:20 -07:00
Paul Nickerson
caf6208dbd install.sh: Print an error and exit the script if $METHOD is set to something unexpected. 2018-10-02 13:46:26 -04:00
Nathan Burchill
0c2efed407 [New] bash_completion: Add support for ZSH_DISABLE_COMPFIX flag.
When using Oh My Zsh the ZSH_DISABLE_COMPFIX flag allows the zsh completion system to use files it deems to be insecure.
2018-09-18 16:15:35 -04:00
et304383
2d97ce5f7b [Docs] add instructions for installing a specific version 2018-08-27 11:50:48 -03:00
Erik Lilja
8542df4ac5 [New] add support for $XDG_CONFIG_HOME 2018-08-14 21:45:40 +02:00
Jordan Harband
f218a85454 [Tests] eslint 5.5+ seems to not install on node 0.10 2018-09-09 14:56:17 -07:00
Jordan Harband
96ebed37c7 Merge pull request #1863 from PeterDaveHello/ImproveDockerfile
Improve Dockerfile
2018-08-23 09:13:47 -07:00
Jordan Harband
e7a37f336d [Tests] fix failing tests on master due to npm registry SSL changes 2018-08-15 15:01:47 -07:00
Daniel Li
e06f735776 Improve Bash alias
This will take into account nested directories inside your main project
directory
2018-07-26 16:13:07 +01:00
Daniel Li
355c4c7915 [Docs] Add section on automatic nvm use in Bash 2018-07-15 19:08:15 +01:00
Peter Dave Hello
4bd99bcfa2 [Dockerfile] Refactor to prevent using sudo during build
`sudo` may lead to unpredictable behavior in some cases, and we don't
really need to use `sudo` to reach what we need.
2018-07-12 18:38:15 +08:00
Peter Dave Hello
5f9ccaada0 [Dockerfile] Set the SHELL to bash with pipefail option 2018-07-12 18:38:15 +08:00
Peter Dave Hello
7ff20855a2 [Tests] Integrate dockerfile_lint to test Dockerfile 2018-07-12 18:38:14 +08:00
Peter Dave Hello
cdde74a55d [Dockerfile] install missing eclint package 2018-07-12 18:37:40 +08:00
Jordan Harband
17c33fd9ae Merge pull request #1861 from PeterDaveHello/ImproveDockerfile
Improve and update Dockerfile
2018-07-11 12:15:25 -07:00
Peter Dave Hello
04b35b5440 [Dockerfile] Use arguments JSON notation for ENTRYPOINT 2018-07-11 15:17:27 +08:00
Peter Dave Hello
aacb0b9b97 [Dockerfile] Fix command From to be FROM 2018-07-11 15:17:27 +08:00
Peter Dave Hello
f121e5ace0 [Dockerfile] Add missing quotes for variables 2018-07-11 15:17:18 +08:00
Peter Dave Hello
af8038ffec [Dockerfile] Update ShellCheck version to v0.5.0 2018-07-11 15:14:00 +08:00
Peter Dave Hello
265ec90532 [Dockerfile] Add missing name & version LABEL 2018-07-11 15:14:00 +08:00
Peter Dave Hello
e2195b4c35 [Dockerfile] Use LABEL instead of deprecated MAINTAINER command 2018-07-11 15:13:57 +08:00
JBallin
41dc4218b9 [Docs] add --no-use option to installation 2018-06-17 21:31:56 -07:00
Xandor Schiefer
90cfb5d771 [Fix] use: Prepend instead of changing if shadowed by system dirs (fixes #1652) 2018-06-08 15:23:02 +02:00
Joshua Li
0cdc184168 [Fix] Improve nvm_is_version_installed to check for a node executable instead of root dir 2018-05-31 15:26:30 -07:00
Joshua Li
a5f42d9cea [Tests] update most mkdirs to use make_fake_{node,iojs} 2018-06-13 10:38:19 -07:00
Xandor Schiefer
eabd7ab13d Respect previously nvm-loaded node version when sourcing 2016-11-14 19:18:24 +02:00
Jordan Harband
b111436fde [Tests] test nvm install-latest-npm on io.js v2 2018-06-06 22:49:56 -07:00
Spike Grobstein
9854928ba9 [New] install.sh: allow user to explicitly opt out of nvm adding the source string
this is done by checking if the user supplies `PROFILE=/dev/null` when running `install.sh`, the `nvm_detect_profile` function will not output any strings, causing `nvm_do_install` to skip adding `SOURCE_STR`.
2018-05-03 08:22:07 -07:00
Jordan Harband
c50ea6f0a3 [shellcheck] quote variables in for loops to avoid unintentional expansion 2018-05-31 23:56:20 -07:00
Jordan Harband
628d4fac84 [shellcheck] use { …; } instead of (…) to group test commands 2018-05-31 23:49:15 -07:00
Jordan Harband
ef35bc4cb6 Merge pull request #1823 from SrHuevo/master
fix for .nvmrc script
2018-05-30 20:08:07 -04:00
SrHuevo
d08d8607f5 fix for .nvmrc script 2018-05-30 09:02:29 +02:00
Jay Williams
e7b53a01fd Grammar update 2018-05-26 23:17:08 +01:00
Siddharth Sakhadeo
b81c120e0c fix failing if check in autoload script 2018-05-25 15:33:42 -07:00
Jordan Harband
57ec311f53 [Fix] ls-remote: fix issues in zsh when using a mirror with a ton of entries
Merge pull request #1818 from adedomin/master
2018-05-24 14:08:20 -04:00
Jordan Harband
38b32c27f3 [Tests] update mock data 2018-05-23 23:48:50 -04:00
adedomin
7a5ff0d133 [Fix] ls-remote: fix issues in zsh when using a mirror with a ton of entries
Fixes #1813
2018-05-23 19:47:11 -04:00
Jordan Harband
f5f029c409 [Fix] “unstable” alias: when there’s no “unstable” minors, output “N/A” 2018-05-24 12:23:02 -04:00
Jordan Harband
c465a83518 [Tests] nvm ls-remote: add test for overly-large tab file 2018-05-23 23:48:04 -04:00
Peter Dave Hello
62ee7cf998 [Refactor] bash_completion: Improve coding style 2018-05-21 19:59:01 +08:00
Peter Dave Hello
113d807e5a [New] Support --no-progress for nvm install
Closes #1079.
2017-03-10 01:07:16 +08:00
Jordan Harband
3fc7b737f5 [Fix] install -s: zsh: ensure shwordsplit opt is set
Fixes #1719.
2018-04-29 15:35:39 -07:00
Josh Sleeper
04c27e23fe add --tags to git fetch in manual upgrade
facilitates older `git` fetching tags so that it can actually upgrade properly
2018-04-25 14:55:31 -07:00
Jordan Harband
592c0be195 Merge tag 'v0.33.11'
v0.33.11

Fixes
 - `nvm install-latest-npm`: node v4.5 and v4.6 work on npm v5.4.1, but not v5.4.2
2018-04-25 13:26:19 -07:00
Jordan Harband
eb0a8442d8 [Fix] nvm install-latest-npm: node v4.5 and v4.6 work on npm v5.4.1, but not v5.4.2 2018-04-25 10:08:41 -07:00
Jordan Harband
a26ab88478 [Tests] fix nvm install-latest-npm tests to fail properly 2018-04-24 22:23:44 -07:00
Jordan Harband
1f2a3234d2 [Tests] add nvm install-latest-npm tests for all node versions 2018-04-24 22:23:44 -07:00
Jordan Harband
34e1ec800e Merge tag 'v0.33.10'
v0.33.10

Fixes
 - `install-latest-npm`: npm 6 is out, and requires node 6 or higher
2018-04-24 22:09:27 -07:00
Jordan Harband
c983fefbae Merge pull request #1734 from PeterDaveHello/improve-NVM_DIR-handling
[Fix] Remove $NVM_DIR trailing slash automatically
2018-04-24 16:22:42 -07:00
Jordan Harband
42f11acce1 [Fix] install-latest-npm: npm 6 is out, and requires node 6 or higher 2018-04-24 14:39:46 -07:00
Jordan Harband
09f7bbb78c [Refactor] use a different approach to remove trailing slashes 2018-04-24 13:24:08 -07:00
Peter Dave Hello
d5dacdf80f [Fix] nvm debug: Fix sed syntax error in nvm_command_info() 2018-04-17 18:09:47 +08:00
Peter Dave Hello
d3a9272a0c [Refactor] Speedup nvm_list_aliases() 2018-04-18 17:03:47 +08:00
Peter Dave Hello
685312d600 [Fix] Remove $NVM_DIR trailing slash automatically, fix #1708 2018-04-12 14:14:58 +08:00
Peter Dave Hello
e7b42198b4 [Fix] Improve .nvmrc reading process
Fixes #1015. Fixes #1712.
2018-02-20 03:34:43 +08:00
215 changed files with 10406 additions and 1962 deletions

View File

@@ -12,5 +12,17 @@ trim_trailing_whitespace = true
[*.txt] [*.txt]
indent_size = false indent_size = false
[test/fast/Listing versions/Running 'nvm ls' calls into nvm_alias]
indent_size = false
[test/fast/Listing versions/Running 'nvm ls --no-alias' does not call into nvm_alias]
indent_size = false
[test/fast/Unit tests/mocks/**]
insert_final_newline = off
[test/**/.urchin*]
insert_final_newline = off
[Makefile] [Makefile]
indent_style = tab indent_style = tab

12
.github/FUNDING.yml vendored Normal file
View File

@@ -0,0 +1,12 @@
# These are supported funding model platforms
github: [ljharb]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: npm/nvm
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']

View File

@@ -1,9 +1,9 @@
<!-- Thank you for being interested in nvm! Please help us by filling out the following form if youre having trouble. If you have a feature request, or some other question, please feel free to clear out the form. Thanks! --> <!-- Thank you for being interested in nvm! Please help us by filling out the following form if youre having trouble. If you have a feature request, or some other question, please feel free to clear out the form. Thanks! -->
- Operating system and version: #### Operating system and version:
- `nvm debug` output: #### `nvm debug` output:
<details> <details>
<!-- do not delete the following blank line --> <!-- do not delete the following blank line -->
@@ -12,7 +12,7 @@
``` ```
</details> </details>
- `nvm ls` output: #### `nvm ls` output:
<details> <details>
<!-- do not delete the following blank line --> <!-- do not delete the following blank line -->
@@ -21,21 +21,24 @@
``` ```
</details> </details>
- How did you install `nvm`? (e.g. install script in readme, Homebrew): #### How did you install `nvm`?
<!-- (e.g. install script in readme, Homebrew) -->
- What steps did you perform? #### What steps did you perform?
- What happened? #### What happened?
- What did you expect to happen? #### What did you expect to happen?
- Is there anything in any of your profile files (`.bashrc`, `.bash_profile`, `.zshrc`, etc) that modifies the `PATH`? #### Is there anything in any of your profile files that modifies the `PATH`?
<!-- (e.g. `.bashrc`, `.bash_profile`, `.zshrc`, etc) -->
<!-- if this does not apply, please delete this section --> <!-- Please remove the following section if it does not apply to you -->
- If you are having installation issues, or getting "N/A", what does `curl -I --compressed -v https://nodejs.org/dist/` print out? #### If you are having installation issues, or getting "N/A", what does `curl -I --compressed -v https://nodejs.org/dist/` print out?
<details> <details>
<!-- do not delete the following blank line --> <!-- do not delete the following blank line -->
```sh ```sh
``` ```
</details> </details>

3
.github/SECURITY.md vendored Normal file
View File

@@ -0,0 +1,3 @@
# Security
Please email [@ljharb](https://github.com/ljharb) or see https://tidelift.com/security if you have a potential security vulnerability to report.

76
.github/workflows/latest-npm.yml vendored Normal file
View File

@@ -0,0 +1,76 @@
name: 'Tests: `nvm install-latest-npm`'
on: [pull_request, push]
jobs:
matrix:
runs-on: ubuntu-latest
outputs:
latest: ${{ steps.set-matrix.outputs.requireds }}
steps:
- name: Harden Runner
uses: step-security/harden-runner@v1
with:
allowed-endpoints:
iojs.org:443
nodejs.org:443
- uses: ljharb/actions/node/matrix@main
id: set-matrix
with:
versionsAsRoot: true
type: majors
preset: '>=1'
nodes:
needs: [matrix]
permissions:
contents: read
name: 'nvm install-latest-npm'
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version: ${{ fromJson(needs.matrix.outputs.latest) }}
include:
- node-version: "9.2"
- node-version: "9.1"
- node-version: "9.0"
- node-version: "6.1"
- node-version: "5.9"
- node-version: "4.6"
- node-version: "4.5"
- node-version: "4.4"
- node-version: "0.12"
- node-version: "0.10"
steps:
- name: Harden Runner
uses: step-security/harden-runner@v1
with:
allowed-endpoints:
github.com:443
iojs.org:443
nodejs.org:443
registry.npmjs.org:443
- uses: actions/checkout@v2
- uses: ljharb/actions/node/install@main
name: 'nvm install-latest-npm'
with:
node-version: ${{ matrix.node-version }}
skip-ls-check: true
skip-install: true
- run: npm --version
node:
permissions:
contents: none
name: 'nvm install-latest-npm'
needs: [nodes]
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@v1
with:
egress-policy: block
- run: 'echo tests completed'

73
.github/workflows/lint.yml vendored Normal file
View File

@@ -0,0 +1,73 @@
name: 'Tests: linting'
on: [pull_request, push]
jobs:
eclint:
permissions:
contents: read
runs-on: ubuntu-latest
steps:
- uses: step-security/harden-runner@v1
with:
allowed-endpoints:
github.com:443
nodejs.org:443
registry.npmjs.org:443
- uses: actions/checkout@v2
- uses: ljharb/actions/node/install@main
name: 'nvm install ${{ matrix.node-version }} && npm install'
with:
node-version: 'lts/*'
- run: npm run eclint
dockerfile_lint:
permissions:
contents: read
runs-on: ubuntu-latest
steps:
- uses: step-security/harden-runner@v1
with:
allowed-endpoints:
ghcr.io:443
github.com:443
pkg-containers.githubusercontent.com:443
nodejs.org:443
registry.npmjs.org:443
- uses: actions/checkout@v2
- uses: ljharb/actions/node/install@main
name: 'nvm install ${{ matrix.node-version }} && npm install'
with:
node-version: 'lts/*'
- run: npm run dockerfile_lint
doctoc:
permissions:
contents: read
runs-on: ubuntu-latest
steps:
- uses: step-security/harden-runner@v1
with:
allowed-endpoints:
github.com:443
nodejs.org:443
registry.npmjs.org:443
- uses: actions/checkout@v2
- uses: ljharb/actions/node/install@main
name: 'nvm install ${{ matrix.node-version }} && npm install'
with:
node-version: 'lts/*'
- run: npm run doctoc:check
test_naming:
permissions:
contents: read
runs-on: ubuntu-latest
steps:
- uses: step-security/harden-runner@v1
with:
allowed-endpoints:
github.com:443
- uses: actions/checkout@v2
- name: check tests filenames
run: ./rename_test.sh --check

23
.github/workflows/rebase.yml vendored Normal file
View File

@@ -0,0 +1,23 @@
name: Automatic Rebase
on: [pull_request_target]
jobs:
_:
permissions:
contents: write
name: "Automatic Rebase"
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@v1
with:
allowed-endpoints:
api.github.com:443
github.com:443
- uses: actions/checkout@v2
- uses: ljharb/rebase@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

32
.github/workflows/release.yml vendored Normal file
View File

@@ -0,0 +1,32 @@
name: 'Tests: release process'
on: [pull_request, push]
jobs:
release:
permissions:
contents: read
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@v1
with:
allowed-endpoints:
github.com:443
registry.npmjs.org:443
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: "14"
- run: npm install
- name: Configure git
run: |
git config user.name github-actions
git config user.email github-actions@github.com
git fetch --unshallow --tags -f || git fetch --tags -f
- name: Attempt `make release` process
run: echo proceed | make TAG=99.99.99 release
env:
GIT_EDITOR: "sed -i '1 s/^/99.99.99 make release test/'"
- name: Ensure tag is created
run: git tag | grep v99.99.99

View File

@@ -0,0 +1,21 @@
name: Require “Allow Edits”
on: [pull_request_target]
jobs:
_:
permissions:
pull-requests: read
name: "Require “Allow Edits”"
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@v1
with:
allowed-endpoints:
api.github.com:443
- uses: ljharb/require-allow-edits@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

58
.github/workflows/shellcheck.yml vendored Normal file
View File

@@ -0,0 +1,58 @@
name: 'Tests: shellcheck'
on: [pull_request, push]
jobs:
shellcheck_matrix:
permissions:
contents: read
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
shell:
- bash
- sh
- dash
- ksh
file:
- nvm.sh
include:
- shell: bash
file: install.sh # only supported on bash
- shell: bash
file: bash_completion # only needed in bash/zsh
- shell: bash
file: nvm-exec # only runs in bash
steps:
- name: Harden Runner
uses: step-security/harden-runner@v1
with:
allowed-endpoints:
ghcr.io:443
github.com:443
pkg-containers.githubusercontent.com:443
- uses: actions/checkout@v2
- name: Set up Homebrew
uses: Homebrew/actions/setup-homebrew@master
- name: Install latest shellcheck
run: brew install shellcheck
env:
HOMEBREW_NO_ANALYTICS: 1
- run: which shellcheck
- run: shellcheck --version
- name: Run shellcheck on ${{ matrix.file }}
run: shellcheck -s ${{ matrix.shell }} ${{ matrix.file }}
shellcheck:
permissions:
contents: none
needs: [shellcheck_matrix]
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@v1
with:
egress-policy: block
- run: 'echo tests completed'

37
.github/workflows/toc.yml vendored Normal file
View File

@@ -0,0 +1,37 @@
name: update readme TOC
on: [push]
jobs:
_:
permissions:
contents: write
name: "update readme TOC"
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@v1
with:
allowed-endpoints:
github.com:443
registry.npmjs.org:443
- uses: actions/checkout@v2
with:
# https://github.com/actions/checkout/issues/217#issue-599945005
# pulls all commits (needed for lerna / semantic release to correctly version)
fetch-depth: "0"
# pulls all tags (needed for lerna / semantic release to correctly version)
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
- uses: actions/setup-node@v2
with:
node-version: '12.x'
- run: npm install
- run: npm run doctoc
- name: commit changes
uses: ljharb/actions-js-build/commit@v3+amendpush
with:
amend: true
force: true

133
.github/workflows/windows-npm.yml vendored Normal file
View File

@@ -0,0 +1,133 @@
name: 'Tests on Windows: `nvm install`'
on: [pull_request, push]
env:
NVM_INSTALL_GITHUB_REPO: ${{ github.repository }}
NVM_INSTALL_VERSION: ${{ github.sha }}
jobs:
msys_fail_install:
# Default installation does not work due to npm_config_prefix set to C:\npm\prefix
permissions:
contents: none
name: 'MSYS fail prefix nvm install'
runs-on: windows-latest
steps:
- name: Retrieve nvm
shell: bash
run: |
curl -fsSLo- "https://raw.githubusercontent.com/${NVM_INSTALL_GITHUB_REPO}/${NVM_INSTALL_VERSION}/install.sh" | METHOD=script bash
. "$HOME/.nvm/nvm.sh"
! nvm install --lts
msys_matrix:
permissions:
contents: none
name: 'MSYS nvm install'
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
npm-node-version:
- '--lts'
- '--default 12'
- '--no-progress 10'
steps:
- name: Retrieve nvm
shell: bash
run: |
unset npm_config_prefix
if [ "${{ matrix.npm-node-version }}" = "--lts" ]; then
curl -fsSLo- "https://raw.githubusercontent.com/${NVM_INSTALL_GITHUB_REPO}/${NVM_INSTALL_VERSION}/install.sh" | bash
else
curl -fsSLo- "https://raw.githubusercontent.com/${NVM_INSTALL_GITHUB_REPO}/${NVM_INSTALL_VERSION}/install.sh" | METHOD=script bash
fi
. "$HOME/.nvm/nvm.sh"
nvm install ${{ matrix.npm-node-version }}
cygwin_matrix:
permissions:
contents: none
name: 'Cygwin nvm install'
runs-on: windows-latest
steps:
- name: Install Cygwin
shell: bash
run: |
export SITE='https://mirror.clarkson.edu/cygwin/'
export LOCALDIR="$(pwd)"
export ROOTDIR="$USERPROFILE\\cygwin"
export PACKAGES='bash,git,curl'
curl -fsSLo setup-x86_64.exe 'https://cygwin.com/setup-x86_64.exe'
./setup-x86_64.exe --disable-buggy-antivirus -q -s "$SITE" -l "$LOCALDIR" -R "$ROOTDIR" -P "$PACKAGES"
cat >~/setup.sh <<EOM
unset npm_config_prefix
export NVM_INSTALL_GITHUB_REPO="$NVM_INSTALL_GITHUB_REPO"
export NVM_INSTALL_VERSION="$NVM_INSTALL_VERSION"
curl -fsSLo- "https://raw.githubusercontent.com/${NVM_INSTALL_GITHUB_REPO}/${NVM_INSTALL_VERSION}/install.sh" | bash
. "$HOME/.nvm/nvm.sh"
nvm install --lts
nvm deactivate
rm -rf "$HOME/.nvm/nvm.sh"
curl -fsSLo- "https://raw.githubusercontent.com/${NVM_INSTALL_GITHUB_REPO}/${NVM_INSTALL_VERSION}/install.sh" | METHOD=script bash
. "$HOME/.nvm/nvm.sh"
nvm install 9
EOM
- name: Retrieve nvm
shell: cmd
run: |
cd %USERPROFILE%\cygwin\bin
bash.exe "%USERPROFILE%\setup.sh"
wsl_matrix:
name: 'WSL nvm install'
defaults:
run:
shell: wsl-bash {0}
runs-on: windows-latest
env:
WSLENV: NVM_INSTALL_GITHUB_REPO:NVM_INSTALL_VERSION:/p
strategy:
fail-fast: false
matrix:
wsl-distrib:
- Debian
- Alpine
- Ubuntu-18.04
npm-node-version:
- '--lts'
- '14'
- '12'
- '11'
- '10'
method:
- ''
- 'script'
steps:
- uses: Vampire/setup-wsl@v1
with:
distribution: ${{ matrix.wsl-distrib }}
additional-packages: bash git curl ca-certificates wget
- name: Retrieve nvm on WSL
run: |
if [ -z "${{ matrix.method }}" ]; then
curl -fsSLo- "https://raw.githubusercontent.com/${NVM_INSTALL_GITHUB_REPO}/${NVM_INSTALL_VERSION}/install.sh" | bash
else
curl -fsSLo- "https://raw.githubusercontent.com/${NVM_INSTALL_GITHUB_REPO}/${NVM_INSTALL_VERSION}/install.sh" | METHOD="${{matrix.method}}" bash
fi
. "$HOME/.nvm/nvm.sh"
nvm install ${{ matrix.npm-node-version }}
nvm_windows:
permissions:
contents: none
needs: [wsl_matrix, cygwin_matrix, msys_matrix, msys_fail_install]
runs-on: ubuntu-latest
steps:
- run: 'echo tests completed'

2
.gitignore vendored
View File

@@ -15,7 +15,7 @@ npm-debug.log
.DS_Store .DS_Store
current current
default-packages /default-packages
# Only apps should have lockfiles # Only apps should have lockfiles
npm-shrinkwrap.json npm-shrinkwrap.json

View File

@@ -1,6 +1,5 @@
language: generic language: generic
dist: trusty dist: xenial
sudo: required
addons: addons:
apt: apt:
packages: packages:
@@ -10,37 +9,34 @@ addons:
# - g++-4.8 # - g++-4.8
cache: cache:
ccache: true
directories: directories:
- $HOME/.npm
- $TRAVIS_BUILD_DIR/.cache - $TRAVIS_BUILD_DIR/.cache
- $TRAVIS_BUILD_DIR/node_modules - $TRAVIS_BUILD_DIR/node_modules
before_install: before_install:
- sudo sed -i 's/mozilla\/DST_Root_CA_X3.crt/!mozilla\/DST_Root_CA_X3.crt/g' /etc/ca-certificates.conf
- sudo update-ca-certificates -f
- $SHELL --version 2> /dev/null || dpkg -s $SHELL 2> /dev/null || which $SHELL - $SHELL --version 2> /dev/null || dpkg -s $SHELL 2> /dev/null || which $SHELL
- curl --version - curl --version
- wget --version - wget --version
- bash --version | head
- zsh --version
- dpkg -s dash | grep ^Version | awk '{print $2}'
install: install:
- if [ -z "${SHELLCHECK-}" ]; then nvm install node && npm install && npm prune && npm ls urchin doctoc eclint; fi - if [ -z "${SHELLCHECK-}" ]; then nvm install 16 && nvm unalias default && npm install && npm prune && npm ls urchin doctoc eclint dockerfile_lint; fi
- '[ -z "$WITHOUT_CURL" ] || sudo apt-get remove curl -y' - '[ -z "$WITHOUT_CURL" ] || sudo apt-get remove curl -y'
script: script:
- if [ -n "${MAKE_RELEASE-}" ]; then export GIT_EDITOR="sed -i '1 s/^/99.99.99 make release test/'" && git fetch --unshallow --tags && echo proceed | make TAG=99.99.99 release ; fi
- if [ -n "${DOCTOCCHECK-}" ]; then cp README.md README.md.orig && npm run doctoc && diff -q README.md README.md.orig ; fi
- if [ -n "${ECLINT-}" ]; then npm run eclint ; fi
- if [ -n "${SHELLCHECK-}" ]; then shellcheck -s bash nvm.sh && shellcheck -s sh nvm.sh && shellcheck -s dash nvm.sh && shellcheck -s ksh nvm.sh ; fi
- if [ -n "${SHELLCHECK-}" ]; then shellcheck -s bash install.sh bash_completion nvm-exec ; fi
- if [ -n "${SHELL-}" ] && [ -n "${TEST_SUITE}" ]; then if [ "${TEST_SUITE}" = 'installation_iojs' ]; then travis_retry make TEST_SUITE=$TEST_SUITE URCHIN="$(npm bin)/urchin" test-$SHELL ; else make TEST_SUITE=$TEST_SUITE URCHIN="$(npm bin)/urchin" test-$SHELL; fi; fi - if [ -n "${SHELL-}" ] && [ -n "${TEST_SUITE}" ]; then if [ "${TEST_SUITE}" = 'installation_iojs' ]; then travis_retry make TEST_SUITE=$TEST_SUITE URCHIN="$(npm bin)/urchin" test-$SHELL ; else make TEST_SUITE=$TEST_SUITE URCHIN="$(npm bin)/urchin" test-$SHELL; fi; fi
before_cache: before_cache:
- if [ -n "$WITHOUT_CURL" ]; then sudo apt-get install curl -y ; fi - if [ -n "$WITHOUT_CURL" ]; then sudo apt-get install curl -y ; fi
env: env:
global: global:
- CXX=g++-4.8 - CXX=g++
- CC=gcc-4.8 - CC=gcc
- PATH="$(echo $PATH | sed 's/::/:/')" - PATH="$(echo $PATH | sed 's/::/:/')"
- PATH="/usr/lib/ccache/:$PATH"
- NVM_DIR="${TRAVIS_BUILD_DIR}" - NVM_DIR="${TRAVIS_BUILD_DIR}"
matrix: matrix:
- MAKE_RELEASE=true
- DOCTOCCHECK=true
- SHELLCHECK=true
- ECLINT=true
- SHELL=bash TEST_SUITE=install_script - SHELL=bash TEST_SUITE=install_script
- SHELL=sh TEST_SUITE=fast - SHELL=sh TEST_SUITE=fast
- SHELL=dash TEST_SUITE=fast - SHELL=dash TEST_SUITE=fast

125
CODE_OF_CONDUCT.md Normal file
View File

@@ -0,0 +1,125 @@
# Code of Conduct
`nvm`, as a member project of the OpenJS Foundation, uses [Contributor Covenant v2.1](https://www.contributor-covenant.org/version/2/1/code_of_conduct/) as their code of conduct. The full text is included [below](#contributor-covenant-code-of-conduct) in English, and translations are available from the Contributor Covenant organisation:
- [contributor-covenant.org/translations](https://www.contributor-covenant.org/translations)
- [github.com/ContributorCovenant](https://github.com/ContributorCovenant/contributor_covenant/tree/release/content/version/2/1)
Refer to the sections on reporting and escalation in this document for the specific emails that can be used to report and escalate issues.
## Reporting
### Project Spaces
For reporting issues in spaces related to `nvm` please use the email `ljharb@gmail.com`. `nvm` handles CoC issues related to the spaces that it maintains. Projects maintainers commit to:
- maintain the confidentiality with regard to the reporter of an incident
- to participate in the path for escalation as outlined in the section on Escalation when required.
### Foundation Spaces
For reporting issues in spaces managed by the OpenJS Foundation, for example, repositories within the OpenJS organization, use the email `report@lists.openjsf.org`.
The Cross Project Council (CPC) is responsible for managing these reports and commits to:
- maintain the confidentiality with regard to the reporter of an incident
- to participate in the path for escalation as outlined in the section on Escalation when required.
## Escalation
The OpenJS Foundation maintains a Code of Conduct Panel (CoCP).
This is a foundation-wide team established to manage escalation when a reporter believes that a report to a member project or the CPC has not been properly handled.
In order to escalate to the CoCP send an email to `coc-escalation@lists.openjsf.org`.
For more information, refer to the full [Code of Conduct governance document](https://github.com/openjs-foundation/cross-project-council/blob/master/CODE_OF_CONDUCT.md).
---
# Contributor Covenant Code of Conduct
## Our Pledge
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation.
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
## Our Standards
Examples of behavior that contributes to a positive environment for our community include:
* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
* Focusing on what is best not just for us as individuals, but for the overall community
Examples of unacceptable behavior include:
* The use of sexualized language or imagery, and sexual attention or advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting
## Enforcement Responsibilities
Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
## Scope
This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces.
Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at [@ljharb](ljharb@gmail.com).
All complaints will be reviewed and investigated promptly and fairly.
All community leaders are obligated to respect the privacy and security of the reporter of any incident.
## Enforcement Guidelines
Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
### 1. Correction
**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
### 2. Warning
**Community Impact**: A violation through a single incident or series of actions.
**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
### 3. Temporary Ban
**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
### 4. Permanent Ban
**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
**Consequence**: A permanent ban from any sort of public interaction within the community.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.1, available at
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
Community Impact Guidelines were inspired by
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
For answers to common questions about this code of conduct, see the FAQ at
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
[https://www.contributor-covenant.org/translations][translations].
[homepage]: https://www.contributor-covenant.org
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
[Mozilla CoC]: https://github.com/mozilla/diversity
[FAQ]: https://www.contributor-covenant.org/faq
[translations]: https://www.contributor-covenant.org/translations

View File

@@ -5,10 +5,12 @@ We love pull requests and issues, they're our favorite.
However, before submitting, please review the following: However, before submitting, please review the following:
For bug reports: For bug reports:
- Please make sure the bug is reproducible, and give us the steps to reproduce it, so that we can dig into the problem. - Please make sure the bug is reproducible, and give us the steps to reproduce it, so that we can dig into the problem.
- Please give us as much detail as possible about your environment, so we can more easily confirm the problem. - Please give us as much detail as possible about your environment, so we can more easily confirm the problem.
For pull requests: For pull requests:
- Please include tests. Changes with tests will be merged very quickly. - Please include tests. Changes with tests will be merged very quickly.
- Please manually confirm that your changes work in `bash`, `sh`/`dash`, `ksh`, and `zsh`. Fast tests do run in these shells, but it's nice to manually verify also. - Please manually confirm that your changes work in `bash`, `sh`/`dash`, `ksh`, and `zsh`. Fast tests do run in these shells, but it's nice to manually verify also.
- Please maintain consistent whitespace - 2-space indentation, trailing newlines in all files, etc. - Please maintain consistent whitespace - 2-space indentation, trailing newlines in all files, etc.

View File

@@ -6,16 +6,19 @@
# Please note that it'll use about 1.2 GB disk space and about 15 minutes to # Please note that it'll use about 1.2 GB disk space and about 15 minutes to
# build this image, it depends on your hardware. # build this image, it depends on your hardware.
# Use Ubuntu Trusty Tahr as base image as we're using on Travis CI FROM ubuntu:20.04
# I also tested with Ubuntu 16.04, should be good with it! LABEL maintainer="Peter Dave Hello <hsu@peterdavehello.org>"
From ubuntu:14.04 LABEL name="nvm-dev-env"
MAINTAINER Peter Dave Hello <hsu@peterdavehello.org> LABEL version="latest"
# Set the SHELL to bash with pipefail option
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# Prevent dialog during apt install # Prevent dialog during apt install
ENV DEBIAN_FRONTEND noninteractive ENV DEBIAN_FRONTEND noninteractive
# ShellCheck version # ShellCheck version
ENV SHELLCHECK_VERSION=0.4.7 ENV SHELLCHECK_VERSION=0.7.0
# Pick a Ubuntu apt mirror site for better speed # Pick a Ubuntu apt mirror site for better speed
# ref: https://launchpad.net/ubuntu/+archivemirrors # ref: https://launchpad.net/ubuntu/+archivemirrors
@@ -37,6 +40,8 @@ RUN apt update && \
bsdutils \ bsdutils \
file \ file \
openssl \ openssl \
libssl-dev \
locales \
ca-certificates \ ca-certificates \
ssh \ ssh \
wget \ wget \
@@ -49,24 +54,20 @@ RUN apt update && \
curl \ curl \
git \ git \
jq \ jq \
realpath \
zsh \ zsh \
ksh \ ksh \
gcc-4.8 \ gcc \
g++-4.8 \ g++ \
xz-utils \ xz-utils \
build-essential \ build-essential \
bash-completion && \ bash-completion && \
apt-get clean apt-get clean
# ShellCheck with Ubuntu 14.04 container workaround RUN wget https://github.com/koalaman/shellcheck/releases/download/v$SHELLCHECK_VERSION/shellcheck-v$SHELLCHECK_VERSION.linux.x86_64.tar.xz -O- | \
RUN wget https://storage.googleapis.com/shellcheck/shellcheck-v$SHELLCHECK_VERSION.linux.x86_64.tar.xz -O- | \
tar xJvf - shellcheck-v$SHELLCHECK_VERSION/shellcheck && \ tar xJvf - shellcheck-v$SHELLCHECK_VERSION/shellcheck && \
mv shellcheck-v$SHELLCHECK_VERSION/shellcheck /bin && \ mv shellcheck-v$SHELLCHECK_VERSION/shellcheck /bin && \
rmdir shellcheck-v$SHELLCHECK_VERSION && \ rmdir shellcheck-v$SHELLCHECK_VERSION
touch /tmp/libc.so.6 && \ RUN shellcheck -V
echo "alias shellcheck='LD_LIBRARY_PATH=/tmp /bin/shellcheck'" >> /etc/bash.bashrc
RUN LD_LIBRARY_PATH=/tmp shellcheck -V
# Set locale # Set locale
RUN locale-gen en_US.UTF-8 RUN locale-gen en_US.UTF-8
@@ -83,6 +84,10 @@ RUN wget --version
# Add user "nvm" as non-root user # Add user "nvm" as non-root user
RUN useradd -ms /bin/bash nvm RUN useradd -ms /bin/bash nvm
# Copy and set permission for nvm directory
COPY . /home/nvm/.nvm/
RUN chown nvm:nvm -R "home/nvm/.nvm"
# Set sudoer for "nvm" # Set sudoer for "nvm"
RUN echo 'nvm ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers RUN echo 'nvm ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers
@@ -90,19 +95,17 @@ RUN echo 'nvm ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers
USER nvm USER nvm
# nvm # nvm
COPY . /home/nvm/.nvm/ RUN echo 'export NVM_DIR="$HOME/.nvm"' >> "$HOME/.bashrc"
RUN sudo chown nvm:nvm -R $HOME/.nvm RUN echo '[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm' >> "$HOME/.bashrc"
RUN echo 'export NVM_DIR="$HOME/.nvm"' >> $HOME/.bashrc RUN echo '[ -s "$NVM_DIR/bash_completion" ] && . "$NVM_DIR/bash_completion" # This loads nvm bash_completion' >> "$HOME/.bashrc"
RUN echo '[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm' >> $HOME/.bashrc
RUN echo '[ -s "$NVM_DIR/bash_completion" ] && . "$NVM_DIR/bash_completion" # This loads nvm bash_completion' >> $HOME/.bashrc
# nodejs and tools # nodejs and tools
RUN bash -c 'source $HOME/.nvm/nvm.sh && \ RUN bash -c 'source $HOME/.nvm/nvm.sh && \
nvm install node && \ nvm install node && \
npm install -g doctoc urchin && \ npm install -g doctoc urchin eclint dockerfile_lint && \
npm install --prefix "$HOME/.nvm/"' npm install --prefix "$HOME/.nvm/"'
# Set WORKDIR to nvm directory # Set WORKDIR to nvm directory
WORKDIR /home/nvm/.nvm WORKDIR /home/nvm/.nvm
ENTRYPOINT /bin/bash ENTRYPOINT ["/bin/bash"]

10
GOVERNANCE.md Normal file
View File

@@ -0,0 +1,10 @@
# `nvm` Project Governance
## Maintainers
- [@ljharb](https://github.com/ljharb)
Maintainers are responsible for issue/PR triage, feature additions, maintenance, bugfixes, security fixes, releases, promoting existing contributors to maintainers, managing repo and CI configuration, etc.
## Contributors
Anyone who contributes code or content or time, via issues or pull requests or otherwise. Contributors do not have any additional permissions on the project.

View File

@@ -2,6 +2,8 @@ The MIT License (MIT)
Copyright (c) 2010 Tim Caswell Copyright (c) 2010 Tim Caswell
Copyright (c) 2014 Jordan Harband
Permission is hereby granted, free of charge, to any person obtaining a copy of Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to the Software without restriction, including without limitation the rights to

View File

@@ -80,6 +80,6 @@ release: _ensure-tag _ensure-clean _ensure-current-version
new_ver=`semver -i "$$new_ver" "$$old_ver"` || { echo 'Invalid version-increment specifier: $(TAG)' >&2; exit 2; } \ new_ver=`semver -i "$$new_ver" "$$old_ver"` || { echo 'Invalid version-increment specifier: $(TAG)' >&2; exit 2; } \
fi; \ fi; \
printf "=== Bumping version **$$old_ver** to **$$new_ver** before committing and tagging:\n=== TYPE 'proceed' TO PROCEED, anything else to abort: " && read response && [ "$$response" = 'proceed' ] || { echo 'Aborted.' >&2; exit 2; }; \ printf "=== Bumping version **$$old_ver** to **$$new_ver** before committing and tagging:\n=== TYPE 'proceed' TO PROCEED, anything else to abort: " && read response && [ "$$response" = 'proceed' ] || { echo 'Aborted.' >&2; exit 2; }; \
replace "$$old_ver" "$$new_ver" -- $(VERSIONED_FILES) && \ replace "$$old_ver" "$$new_ver" $(VERSIONED_FILES) && \
git commit -m "v$$new_ver" $(VERSIONED_FILES) && \ git commit -m "v$$new_ver" $(VERSIONED_FILES) && \
git tag -a "v$$new_ver" git tag -a "v$$new_ver"

49
PROJECT_CHARTER.md Normal file
View File

@@ -0,0 +1,49 @@
# `nvm` Charter
nvm is a version manager for Node.js, designed to be installed per-user, and invoked per-shell. nvm works on any POSIX-compliant shell (sh, dash, ksh, zsh, bash), in particular on these platforms: unix, macOS, and Windows WSL.
## Section 0: Guiding Principles
The `nvm` project is part of the [OpenJS Foundation][openjs foundation], which operates transparently, openly, collaboratively, and ethically. Project proposals, timelines, and status must not merely be open, but also easily visible to outsiders.
## Section 1: Scope
`nvm` is a node version manager, focused on making it easy to install and manage multiple Node.js versions. Any features related to managing the installation and removal of Node.js on any node-supported platform are potentially in scope.
## Section 2: Relationship with OpenJS Foundation CPC.
Technical leadership for the projects within the [OpenJS Foundation][openjs foundation] is delegated to the projects through their project charters by the [OpenJS Foundation Cross-Project Council](https://openjsf.org/about/governance/) (CPC). In the case of the `nvm` project, it is delegated to the [`nvm` Maintainers](README.md#maintainers) (the “Maintainers”). The OpenJS Foundation's business leadership is the Board of Directors (the “Board”).
This `nvm` Charter reflects a carefully constructed balanced role for the Maintainers and the CPC in the governance of the OpenJS Foundation. The charter amendment process is for the Maintainers to propose changes using simple majority of the full Maintainers, the proposed changes being subject to review and approval by the CPC. The CPC may additionally make amendments to the project charter at any time, though the CPC will not interfere with day-to-day discussions, votes or meetings of the Maintainers.
### 2.1 Other Formal Project Relationships
Section Intentionally Left Blank
## Section 3: `nvm`'s Maintainers Governing Body
`nvm` is governed by its [maintainers](README.md#maintainers).
## Section 4: Roles & Responsibilities
The roles and responsibilities of `nvm`'s Maintainers are described in [GOVERNANCE.md](./GOVERNANCE.md).
### Section 4.1 Project Operations & Management
Section Intentionally Left Blank
### Section 4.2: Decision-making, Voting, and/or Elections
Section Intentionally Left Blank
### Section 4.3: Other Project Roles
Section Intentionally Left Blank
## Section 5: Definitions
- *Contributors*: contribute code or other artifacts, but do not have the right to commit to the codebase. Contributors work with the projects maintainers to have code committed to the code base. A Contributor may be promoted to a Maintainer by the Maintainers. Contributors should rarely be encumbered by the Maintainers and never by the CPC or OpenJS Foundation Board.
- *Maintainers*: Contributors with any kind of decision-making authority in the project.
[openjs foundation]: https://openjsf.org

650
README.md
View File

@@ -1,89 +1,176 @@
# Node Version Manager [![Build Status](https://travis-ci.org/creationix/nvm.svg?branch=master)][3] [![nvm version](https://img.shields.io/badge/version-v0.33.11-yellow.svg)][4] [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/684/badge)](https://bestpractices.coreinfrastructure.org/projects/684) <a href="https://github.com/nvm-sh/logos"><img alt="nvm project logo" src="https://raw.githubusercontent.com/nvm-sh/logos/HEAD/nvm-logo-color.svg" height="50" /></a>
# Node Version Manager [![Build Status](https://travis-ci.org/nvm-sh/nvm.svg?branch=master)][3] [![nvm version](https://img.shields.io/badge/version-v0.39.2-yellow.svg)][4] [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/684/badge)](https://bestpractices.coreinfrastructure.org/projects/684)
<!-- To update this table of contents, ensure you have run `npm install` then `npm run doctoc` -->
<!-- START doctoc generated TOC please keep comment here to allow auto update --> <!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --> <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
## Table of Contents ## Table of Contents
- [Installation](#installation) - [Intro](#intro)
- [Install script](#install-script) - [About](#about)
- [Verify installation](#verify-installation) - [Installing and Updating](#installing-and-updating)
- [Install & Update Script](#install--update-script)
- [Additional Notes](#additional-notes)
- [Troubleshooting on Linux](#troubleshooting-on-linux)
- [Troubleshooting on macOS](#troubleshooting-on-macos)
- [Ansible](#ansible)
- [Verify Installation](#verify-installation)
- [Important Notes](#important-notes) - [Important Notes](#important-notes)
- [Git install](#git-install) - [Git Install](#git-install)
- [Manual Install](#manual-install) - [Manual Install](#manual-install)
- [Manual upgrade](#manual-upgrade) - [Manual Upgrade](#manual-upgrade)
- [Usage](#usage) - [Usage](#usage)
- [Long-term support](#long-term-support) - [Long-term Support](#long-term-support)
- [Migrating global packages while installing](#migrating-global-packages-while-installing) - [Migrating Global Packages While Installing](#migrating-global-packages-while-installing)
- [Default global packages from file while installing](#default-global-packages-from-file-while-installing) - [Default Global Packages From File While Installing](#default-global-packages-from-file-while-installing)
- [io.js](#iojs) - [io.js](#iojs)
- [System version of node](#system-version-of-node) - [System Version of Node](#system-version-of-node)
- [Listing versions](#listing-versions) - [Listing Versions](#listing-versions)
- [Setting Custom Colors](#setting-custom-colors)
- [Persisting custom colors](#persisting-custom-colors)
- [Suppressing colorized output](#suppressing-colorized-output)
- [Restoring PATH](#restoring-path)
- [Set default node version](#set-default-node-version)
- [Use a mirror of node binaries](#use-a-mirror-of-node-binaries)
- [.nvmrc](#nvmrc) - [.nvmrc](#nvmrc)
- [Deeper Shell Integration](#deeper-shell-integration) - [Deeper Shell Integration](#deeper-shell-integration)
- [bash](#bash)
- [Automatically call `nvm use`](#automatically-call-nvm-use)
- [zsh](#zsh) - [zsh](#zsh)
- [Calling `nvm use` automatically in a directory with a `.nvmrc` file](#calling-nvm-use-automatically-in-a-directory-with-a-nvmrc-file) - [Calling `nvm use` automatically in a directory with a `.nvmrc` file](#calling-nvm-use-automatically-in-a-directory-with-a-nvmrc-file)
- [License](#license) - [fish](#fish)
- [Running tests](#running-tests) - [Calling `nvm use` automatically in a directory with a `.nvmrc` file](#calling-nvm-use-automatically-in-a-directory-with-a-nvmrc-file-1)
- [Bash completion](#bash-completion) - [Running Tests](#running-tests)
- [Environment variables](#environment-variables)
- [Bash Completion](#bash-completion)
- [Usage](#usage-1) - [Usage](#usage-1)
- [Compatibility Issues](#compatibility-issues) - [Compatibility Issues](#compatibility-issues)
- [Installing nvm on Alpine Linux](#installing-nvm-on-alpine-linux) - [Installing nvm on Alpine Linux](#installing-nvm-on-alpine-linux)
- [Removal](#removal) - [Alpine Linux 3.13+](#alpine-linux-313)
- [Alpine Linux 3.5 - 3.12](#alpine-linux-35---312)
- [Uninstalling / Removal](#uninstalling--removal)
- [Manual Uninstall](#manual-uninstall) - [Manual Uninstall](#manual-uninstall)
- [Docker for development environment](#docker-for-development-environment) - [Docker For Development Environment](#docker-for-development-environment)
- [Problems](#problems) - [Problems](#problems)
- [Mac OS "troubleshooting"](#mac-os-troubleshooting) - [macOS Troubleshooting](#macos-troubleshooting)
- [Maintainers](#maintainers)
- [License](#license)
- [Copyright notice](#copyright-notice)
<!-- END doctoc generated TOC please keep comment here to allow auto update --> <!-- END doctoc generated TOC please keep comment here to allow auto update -->
## Installation ## Intro
### Install script `nvm` allows you to quickly install and use different versions of node via the command line.
To install or update nvm, you can use the [install script][2] using cURL:
**Example:**
```sh ```sh
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash $ nvm use 16
Now using node v16.9.1 (npm v7.21.1)
$ node -v
v16.9.1
$ nvm use 14
Now using node v14.18.0 (npm v6.14.15)
$ node -v
v14.18.0
$ nvm install 12
Now using node v12.22.6 (npm v6.14.5)
$ node -v
v12.22.6
``` ```
or Wget: Simple as that!
## About
nvm is a version manager for [node.js](https://nodejs.org/en/), designed to be installed per-user, and invoked per-shell. `nvm` works on any POSIX-compliant shell (sh, dash, ksh, zsh, bash), in particular on these platforms: unix, macOS, and [windows WSL](https://github.com/nvm-sh/nvm#important-notes).
<a id="installation-and-update"></a>
<a id="install-script"></a>
## Installing and Updating
### Install & Update Script
To **install** or **update** nvm, you should run the [install script][2]. To do that, you may either download and run the script manually, or use the following cURL or Wget command:
```sh ```sh
wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh | bash
```
```sh
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh | bash
``` ```
<sub>The script clones the nvm repository to `~/.nvm` and adds the source line to your profile (`~/.bash_profile`, `~/.zshrc`, `~/.profile`, or `~/.bashrc`).</sub> Running either of the above commands downloads a script and runs it. The script clones the nvm repository to `~/.nvm`, and attempts to add the source lines from the snippet below to the correct profile file (`~/.bash_profile`, `~/.zshrc`, `~/.profile`, or `~/.bashrc`).
<a id="profile_snippet"></a>
```sh ```sh
export NVM_DIR="$HOME/.nvm" export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
``` ```
You can customize the install source, directory, profile, and version using the `NVM_SOURCE`, `NVM_DIR`, `PROFILE`, and `NODE_VERSION` variables. #### Additional Notes
- If the environment variable `$XDG_CONFIG_HOME` is present, it will place the `nvm` files there.</sub>
- You can add `--no-use` to the end of the above script (...`nvm.sh --no-use`) to postpone using `nvm` until you manually [`use`](#usage) it.
- You can customize the install source, directory, profile, and version using the `NVM_SOURCE`, `NVM_DIR`, `PROFILE`, and `NODE_VERSION` variables.
Eg: `curl ... | NVM_DIR="path/to/nvm"`. Ensure that the `NVM_DIR` does not contain a trailing slash. Eg: `curl ... | NVM_DIR="path/to/nvm"`. Ensure that the `NVM_DIR` does not contain a trailing slash.
<sub>*NB. The installer can use `git`, `curl`, or `wget` to download `nvm`, whatever is available.*</sub> - The installer can use `git`, `curl`, or `wget` to download `nvm`, whichever is available.
**Note:** On Linux, after running the install script, if you get `nvm: command not found` or see no feedback from your terminal after you type: #### Troubleshooting on Linux
```sh On Linux, after running the install script, if you get `nvm: command not found` or see no feedback from your terminal after you type `command -v nvm`, simply close your current terminal, open a new terminal, and try verifying again.
command -v nvm Alternatively, you can run the following commands for the different shells on the command line:
*bash*: `source ~/.bashrc`
*zsh*: `source ~/.zshrc`
*ksh*: `. ~/.profile`
These should pick up the `nvm` command.
#### Troubleshooting on macOS
Since OS X 10.9, `/usr/bin/git` has been preset by Xcode command line tools, which means we can't properly detect if Git is installed or not. You need to manually install the Xcode command line tools before running the install script, otherwise, it'll fail. (see [#1782](https://github.com/nvm-sh/nvm/issues/1782))
If you get `nvm: command not found` after running the install script, one of the following might be the reason:
- Since macOS 10.15, the default shell is `zsh` and nvm will look for `.zshrc` to update, none is installed by default. Create one with `touch ~/.zshrc` and run the install script again.
- If you use bash, the previous default shell, your system may not have `.bash_profile` or `.bashrc` files where the command is set up. Create one of them with `touch ~/.bash_profile` or `touch ~/.bashrc` and run the install script again. Then, run `. ~/.bash_profile` or `. ~/.bashrc` to pick up the `nvm` command.
- You have previously used `bash`, but you have `zsh` installed. You need to manually add [these lines](#manual-install) to `~/.zshrc` and run `. ~/.zshrc`.
- You might need to restart your terminal instance or run `. ~/.nvm/nvm.sh`. Restarting your terminal/opening a new tab/window, or running the source command will load the command and the new configuration.
- If the above didn't help, you might need to restart your terminal instance. Try opening a new tab/window in your terminal and retry.
If the above doesn't fix the problem, you may try the following:
- If you use bash, it may be that your `.bash_profile` (or `~/.profile`) does not source your `~/.bashrc` properly. You could fix this by adding `source ~/<your_profile_file>` to it or follow the next step below.
- Try adding [the snippet from the install section](#profile_snippet), that finds the correct nvm directory and loads nvm, to your usual profile (`~/.bash_profile`, `~/.zshrc`, `~/.profile`, or `~/.bashrc`).
- For more information about this issue and possible workarounds, please [refer here](https://github.com/nvm-sh/nvm/issues/576)
**Note** For Macs with the M1 chip, node started offering **arm64** arch darwin packages since v16.0.0 and experimental **arm64** support when compiling from source since v14.17.0. If you are facing issues installing node using `nvm`, you may want to update to one of those versions or later.
#### Ansible
You can use a task:
```yaml
- name: Install nvm
ansible.builtin.shell: >
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh | bash
args:
creates: "{{ ansible_env.HOME }}/.nvm/nvm.sh"
``` ```
simply close your current terminal, open a new terminal, and try verifying again.
**Note:** Since OS X 10.9, `/usr/bin/git` was preset by Xcode command line tools, which caused Git can't be properly detected if it's installed or not. You need to manually install the Xcode command line tools before running the install script, otherwise, it'll fail. (see [#1782](https://github.com/creationix/nvm/issues/1782)) ### Verify Installation
**Note:** On OS X, if you get `nvm: command not found` after running the install script, one of the following might be the reason:-
- your system may not have a [`.bash_profile file`] where the command is set up. Simply create one with `touch ~/.bash_profile` and run the install script again
- you might need to restart your terminal instance. Try opening a new tab/window in your terminal and retry.
If the above doesn't fix the problem, open your `.bash_profile` and add the following line of code:
`source ~/.bashrc`
- For more information about this issue and possible workarounds, please [refer here](https://github.com/creationix/nvm/issues/576)
### Verify installation
To verify that nvm has been installed, do: To verify that nvm has been installed, do:
@@ -91,48 +178,57 @@ To verify that nvm has been installed, do:
command -v nvm command -v nvm
``` ```
which should output 'nvm' if the installation was successful. Please note that `which nvm` will not work, since `nvm` is a sourced shell function, not an executable binary. which should output `nvm` if the installation was successful. Please note that `which nvm` will not work, since `nvm` is a sourced shell function, not an executable binary.
**Note:** On Linux, after running the install script, if you get `nvm: command not found` or see no feedback from your terminal after you type `command -v nvm`, simply close your current terminal, open a new terminal, and try verifying again.
### Important Notes ### Important Notes
If you're running a system without prepackaged binary available, which means you're going to install nodejs or io.js from its source code, you need to make sure your system has a C++ compiler. For OS X, Xcode will work, for Debian/Ubuntu based GNU/Linux, the `build-essential` and `libssl-dev` packages work. If you're running a system without prepackaged binary available, which means you're going to install nodejs or io.js from its source code, you need to make sure your system has a C++ compiler. For OS X, Xcode will work, for Debian/Ubuntu based GNU/Linux, the `build-essential` and `libssl-dev` packages work.
**Note:** `nvm` does not support Windows (see [#284](https://github.com/creationix/nvm/issues/284)). Two alternatives exist, which are neither supported nor developed by us: **Note:** `nvm` also support Windows in some cases. It should work through WSL (Windows Subsystem for Linux) depending on the version of WSL. It should also work with [GitBash](https://gitforwindows.org/) (MSYS) or [Cygwin](https://cygwin.com). Otherwise, for Windows, a few alternatives exist, which are neither supported nor developed by us:
- [nvm-windows](https://github.com/coreybutler/nvm-windows) - [nvm-windows](https://github.com/coreybutler/nvm-windows)
- [nodist](https://github.com/marcelklehr/nodist) - [nodist](https://github.com/marcelklehr/nodist)
- [nvs](https://github.com/jasongin/nvs)
**Note:** `nvm` does not support [Fish] either (see [#303](https://github.com/nvm-sh/nvm/issues/303)). Alternatives exist, which are neither supported nor developed by us:
**Note:** `nvm` does not support [Fish] either (see [#303](https://github.com/creationix/nvm/issues/303)). Alternatives exist, which are neither supported nor developed by us:
- [bass](https://github.com/edc/bass) allows you to use utilities written for Bash in fish shell - [bass](https://github.com/edc/bass) allows you to use utilities written for Bash in fish shell
- [fast-nvm-fish](https://github.com/brigand/fast-nvm-fish) only works with version numbers (not aliases) but doesn't significantly slow your shell startup - [fast-nvm-fish](https://github.com/brigand/fast-nvm-fish) only works with version numbers (not aliases) but doesn't significantly slow your shell startup
- [plugin-nvm](https://github.com/derekstavis/plugin-nvm) plugin for [Oh My Fish](https://github.com/oh-my-fish/oh-my-fish), which makes nvm and its completions available in fish shell - [plugin-nvm](https://github.com/derekstavis/plugin-nvm) plugin for [Oh My Fish](https://github.com/oh-my-fish/oh-my-fish), which makes nvm and its completions available in fish shell
- [fnm](https://github.com/fisherman/fnm) - [fisherman](https://github.com/fisherman/fisherman)-based version manager for fish - [fnm](https://github.com/fisherman/fnm) - [fisherman](https://github.com/fisherman/fisherman)-based version manager for fish
- [fish-nvm](https://github.com/FabioAntunes/fish-nvm) - Wrapper around nvm for fish, delays sourcing nvm until it's actually used.
**Note:** We still have some problems with FreeBSD, because there is no official pre-built binary for FreeBSD, and building from source may need [patches](https://www.freshports.org/www/node/files/patch-deps_v8_src_base_platform_platform-posix.cc); see the issue ticket: **Note:** We still have some problems with FreeBSD, because there is no official pre-built binary for FreeBSD, and building from source may need [patches](https://www.freshports.org/www/node/files/patch-deps_v8_src_base_platform_platform-posix.cc); see the issue ticket:
- [[#900] [Bug] nodejs on FreeBSD may need to be patched ](https://github.com/creationix/nvm/issues/900)
- [[#900] [Bug] nodejs on FreeBSD may need to be patched](https://github.com/nvm-sh/nvm/issues/900)
- [nodejs/node#3716](https://github.com/nodejs/node/issues/3716) - [nodejs/node#3716](https://github.com/nodejs/node/issues/3716)
**Note:** On OS X, if you do not have Xcode installed and you do not wish to download the ~4.3GB file, you can install the `Command Line Tools`. You can check out this blog post on how to just that: **Note:** On OS X, if you do not have Xcode installed and you do not wish to download the ~4.3GB file, you can install the `Command Line Tools`. You can check out this blog post on how to just that:
- [How to Install Command Line Tools in OS X Mavericks & Yosemite (Without Xcode)](http://osxdaily.com/2014/02/12/install-command-line-tools-mac-os-x/)
- [How to Install Command Line Tools in OS X Mavericks & Yosemite (Without Xcode)](https://osxdaily.com/2014/02/12/install-command-line-tools-mac-os-x/)
**Note:** On OS X, if you have/had a "system" node installed and want to install modules globally, keep in mind that: **Note:** On OS X, if you have/had a "system" node installed and want to install modules globally, keep in mind that:
- When using nvm you do not need `sudo` to globally install a module with `npm -g`, so instead of doing `sudo npm install -g grunt`, do instead `npm install -g grunt`
- If you have an `~/.npmrc` file, make sure it does not contain any `prefix` settings (which is not compatible with nvm) - When using `nvm` you do not need `sudo` to globally install a module with `npm -g`, so instead of doing `sudo npm install -g grunt`, do instead `npm install -g grunt`
- You can (but should not?) keep your previous "system" node install, but nvm will only be available to your user account (the one used to install nvm). This might cause version mismatches, as other users will be using `/usr/local/lib/node_modules/*` VS your user account using `~/.nvm/versions/node/vX.X.X/lib/node_modules/*` - If you have an `~/.npmrc` file, make sure it does not contain any `prefix` settings (which is not compatible with `nvm`)
- You can (but should not?) keep your previous "system" node install, but `nvm` will only be available to your user account (the one used to install nvm). This might cause version mismatches, as other users will be using `/usr/local/lib/node_modules/*` VS your user account using `~/.nvm/versions/node/vX.X.X/lib/node_modules/*`
Homebrew installation is not supported. If you have issues with homebrew-installed `nvm`, please `brew uninstall` it, and install it using the instructions below, before filing an issue. Homebrew installation is not supported. If you have issues with homebrew-installed `nvm`, please `brew uninstall` it, and install it using the instructions below, before filing an issue.
**Note:** If you're using `zsh` you can easily install `nvm` as a zsh plugin. Install [`zsh-nvm`](https://github.com/lukechilds/zsh-nvm) and run `nvm upgrade` to upgrade. **Note:** If you're using `zsh` you can easily install `nvm` as a zsh plugin. Install [`zsh-nvm`](https://github.com/lukechilds/zsh-nvm) and run `nvm upgrade` to upgrade.
**Note:** Git versions before v1.7 may face a problem of cloning nvm source from GitHub via https protocol, and there is also different behavior of git before v1.6, and git prior to [v1.17.10](https://github.com/git/git/commit/5a7d5b683f869d3e3884a89775241afa515da9e7) can not clone tags, so the minimum required git version is v1.7.10. If you are interested in the problem we mentioned here, please refer to GitHub's [HTTPS cloning errors](https://help.github.com/articles/https-cloning-errors/) article. **Note:** Git versions before v1.7 may face a problem of cloning `nvm` source from GitHub via https protocol, and there is also different behavior of git before v1.6, and git prior to [v1.17.10](https://github.com/git/git/commit/5a7d5b683f869d3e3884a89775241afa515da9e7) can not clone tags, so the minimum required git version is v1.7.10. If you are interested in the problem we mentioned here, please refer to GitHub's [HTTPS cloning errors](https://help.github.com/articles/https-cloning-errors/) article.
### Git install ### Git Install
If you have `git` installed (requires git v1.7.10+): If you have `git` installed (requires git v1.7.10+):
1. clone this repo in the root of your user profile 1. clone this repo in the root of your user profile
- `cd ~/` from anywhere then `git clone https://github.com/creationix/nvm.git .nvm` - `cd ~/` from anywhere then `git clone https://github.com/nvm-sh/nvm.git .nvm`
2. `cd ~/.nvm` and check out the latest version with `git checkout v0.33.11` 1. `cd ~/.nvm` and check out the latest version with `git checkout v0.39.2`
3. activate nvm by sourcing it from your shell: `. nvm.sh` 1. activate `nvm` by sourcing it from your shell: `. ./nvm.sh`
Now add these lines to your `~/.bashrc`, `~/.profile`, or `~/.zshrc` file to have it automatically sourced upon login: Now add these lines to your `~/.bashrc`, `~/.profile`, or `~/.zshrc` file to have it automatically sourced upon login:
(you may have to add to more than one of the above files) (you may have to add to more than one of the above files)
@@ -145,11 +241,11 @@ export NVM_DIR="$HOME/.nvm"
### Manual Install ### Manual Install
For a fully manual install, create a folder somewhere in your filesystem with the `nvm.sh` file inside it. I put mine in `~/.nvm` and added the following to the `nvm.sh` file. For a fully manual install, execute the following lines to first clone the `nvm` repository into `$HOME/.nvm`, and then load `nvm`:
```sh ```sh
export NVM_DIR="$HOME/.nvm" && ( export NVM_DIR="$HOME/.nvm" && (
git clone https://github.com/creationix/nvm.git "$NVM_DIR" git clone https://github.com/nvm-sh/nvm.git "$NVM_DIR"
cd "$NVM_DIR" cd "$NVM_DIR"
git checkout `git describe --abbrev=0 --tags --match "v[0-9]*" $(git rev-list --tags --max-count=1)` git checkout `git describe --abbrev=0 --tags --match "v[0-9]*" $(git rev-list --tags --max-count=1)`
) && \. "$NVM_DIR/nvm.sh" ) && \. "$NVM_DIR/nvm.sh"
@@ -161,9 +257,10 @@ Now add these lines to your `~/.bashrc`, `~/.profile`, or `~/.zshrc` file to hav
```sh ```sh
export NVM_DIR="$HOME/.nvm" export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
``` ```
### Manual upgrade ### Manual Upgrade
For manual upgrade with `git` (requires git v1.7.10+): For manual upgrade with `git` (requires git v1.7.10+):
@@ -175,7 +272,7 @@ For manual upgrade with `git` (requires git v1.7.10+):
```sh ```sh
( (
cd "$NVM_DIR" cd "$NVM_DIR"
git fetch origin git fetch --tags origin
git checkout `git describe --abbrev=0 --tags --match "v[0-9]*" $(git rev-list --tags --max-count=1)` git checkout `git describe --abbrev=0 --tags --match "v[0-9]*" $(git rev-list --tags --max-count=1)`
) && \. "$NVM_DIR/nvm.sh" ) && \. "$NVM_DIR/nvm.sh"
``` ```
@@ -185,7 +282,21 @@ For manual upgrade with `git` (requires git v1.7.10+):
To download, compile, and install the latest release of node, do this: To download, compile, and install the latest release of node, do this:
```sh ```sh
nvm install node nvm install node # "node" is an alias for the latest version
```
To install a specific version of node:
```sh
nvm install 14.7.0 # or 16.3.0, 12.22.1, etc
```
The first version installed becomes the default. New shells will start with the default version of node (e.g., `nvm alias default`).
You can list available versions using `ls-remote`:
```sh
nvm ls-remote
``` ```
And then in any new shell just use the installed version: And then in any new shell just use the installed version:
@@ -199,6 +310,7 @@ Or you can just run it:
```sh ```sh
nvm run node --version nvm run node --version
``` ```
Or, you can run any arbitrary command in a subshell with the desired version of node: Or, you can run any arbitrary command in a subshell with the desired version of node:
```sh ```sh
@@ -208,18 +320,20 @@ nvm exec 4.2 node --version
You can also get the path to the executable to where it was installed: You can also get the path to the executable to where it was installed:
```sh ```sh
nvm which 5.0 nvm which 12.22
``` ```
In place of a version pointer like "0.10" or "5.0" or "4.2.1", you can use the following special default aliases with `nvm install`, `nvm use`, `nvm run`, `nvm exec`, `nvm which`, etc: In place of a version pointer like "14.7" or "16.3" or "12.22.1", you can use the following special default aliases with `nvm install`, `nvm use`, `nvm run`, `nvm exec`, `nvm which`, etc:
- `node`: this installs the latest version of [`node`](https://nodejs.org/en/) - `node`: this installs the latest version of [`node`](https://nodejs.org/en/)
- `iojs`: this installs the latest version of [`io.js`](https://iojs.org/en/) - `iojs`: this installs the latest version of [`io.js`](https://iojs.org/en/)
- `stable`: this alias is deprecated, and only truly applies to `node` `v0.12` and earlier. Currently, this is an alias for `node`. - `stable`: this alias is deprecated, and only truly applies to `node` `v0.12` and earlier. Currently, this is an alias for `node`.
- `unstable`: this alias points to `node` `v0.11` - the last "unstable" node release, since post-1.0, all node versions are stable. (in SemVer, versions communicate breakage, not stability). - `unstable`: this alias points to `node` `v0.11` - the last "unstable" node release, since post-1.0, all node versions are stable. (in SemVer, versions communicate breakage, not stability).
### Long-term support ### Long-term Support
Node has a [schedule](https://github.com/nodejs/LTS#lts_schedule) for long-term support (LTS) You can reference LTS versions in aliases and `.nvmrc` files with the notation `lts/*` for the latest LTS, and `lts/argon` for LTS releases from the "argon" line, for example. In addition, the following commands support LTS arguments:
Node has a [schedule](https://github.com/nodejs/Release#release-schedule) for long-term support (LTS) You can reference LTS versions in aliases and `.nvmrc` files with the notation `lts/*` for the latest LTS, and `lts/argon` for LTS releases from the "argon" line, for example. In addition, the following commands support LTS arguments:
- `nvm install --lts` / `nvm install --lts=argon` / `nvm install 'lts/*'` / `nvm install lts/argon` - `nvm install --lts` / `nvm install --lts=argon` / `nvm install 'lts/*'` / `nvm install lts/argon`
- `nvm uninstall --lts` / `nvm uninstall --lts=argon` / `nvm uninstall 'lts/*'` / `nvm uninstall lts/argon` - `nvm uninstall --lts` / `nvm uninstall --lts=argon` / `nvm uninstall 'lts/*'` / `nvm uninstall lts/argon`
- `nvm use --lts` / `nvm use --lts=argon` / `nvm use 'lts/*'` / `nvm use lts/argon` - `nvm use --lts` / `nvm use --lts=argon` / `nvm use 'lts/*'` / `nvm use lts/argon`
@@ -230,7 +344,14 @@ Node has a [schedule](https://github.com/nodejs/LTS#lts_schedule) for long-term
Any time your local copy of `nvm` connects to https://nodejs.org, it will re-create the appropriate local aliases for all available LTS lines. These aliases (stored under `$NVM_DIR/alias/lts`), are managed by `nvm`, and you should not modify, remove, or create these files - expect your changes to be undone, and expect meddling with these files to cause bugs that will likely not be supported. Any time your local copy of `nvm` connects to https://nodejs.org, it will re-create the appropriate local aliases for all available LTS lines. These aliases (stored under `$NVM_DIR/alias/lts`), are managed by `nvm`, and you should not modify, remove, or create these files - expect your changes to be undone, and expect meddling with these files to cause bugs that will likely not be supported.
### Migrating global packages while installing To get the latest LTS version of node and migrate your existing installed packages, use
```sh
nvm install 'lts/*' --reinstall-packages-from=current
```
### Migrating Global Packages While Installing
If you want to install a new version of Node.js and migrate npm packages from a previous version: If you want to install a new version of Node.js and migrate npm packages from a previous version:
```sh ```sh
@@ -246,9 +367,25 @@ nvm install 6 --reinstall-packages-from=5
nvm install v4.2 --reinstall-packages-from=iojs nvm install v4.2 --reinstall-packages-from=iojs
``` ```
### Default global packages from file while installing Note that reinstalling packages _explicitly does not update the npm version_ — this is to ensure that npm isn't accidentally upgraded to a broken version for the new node version.
If you have a list of default packages you want installed every time you install a new version we support that too. You can add anything npm would accept as a package argument on the command line. To update npm at the same time add the `--latest-npm` flag, like this:
```sh
nvm install 'lts/*' --reinstall-packages-from=default --latest-npm
```
or, you can at any time run the following command to get the latest supported npm version on the current node version:
```sh
nvm install-latest-npm
```
If you've already gotten an error to the effect of "npm does not support Node.js", you'll need to (1) revert to a previous node version (`nvm ls` & `nvm use <your latest _working_ version from the ls>`, (2) delete the newly created node version (`nvm uninstall <your _broken_ version of node from the ls>`), then (3) rerun your `nvm install` with the `--latest-npm` flag.
### Default Global Packages From File While Installing
If you have a list of default packages you want installed every time you install a new version, we support that too -- just add the package names, one per line, to the file `$NVM_DIR/default-packages`. You can add anything npm would accept as a package argument on the command line.
```sh ```sh
# $NVM_DIR/default-packages # $NVM_DIR/default-packages
@@ -259,6 +396,7 @@ stevemao/left-pad
``` ```
### io.js ### io.js
If you want to install [io.js](https://github.com/iojs/io.js/): If you want to install [io.js](https://github.com/iojs/io.js/):
```sh ```sh
@@ -271,9 +409,10 @@ If you want to install a new version of io.js and migrate npm packages from a pr
nvm install iojs --reinstall-packages-from=iojs nvm install iojs --reinstall-packages-from=iojs
``` ```
The same guidelines mentioned for migrating npm packages in Node.js are applicable to io.js. The same guidelines mentioned for migrating npm packages in node are applicable to io.js.
### System Version of Node
### System version of node
If you want to use the system-installed version of node, you can use the special default alias "system": If you want to use the system-installed version of node, you can use the special default alias "system":
```sh ```sh
@@ -281,7 +420,8 @@ nvm use system
nvm run system --version nvm run system --version
``` ```
### Listing versions ### Listing Versions
If you want to see what versions are installed: If you want to see what versions are installed:
```sh ```sh
@@ -294,18 +434,66 @@ If you want to see what versions are available to install:
nvm ls-remote nvm ls-remote
``` ```
### Setting Custom Colors
You can set five colors that will be used to display version and alias information. These colors replace the default colors.
Initial colors are: g b y r e
Color codes:
r/R = red / bold red
g/G = green / bold green
b/B = blue / bold blue
c/C = cyan / bold cyan
m/M = magenta / bold magenta
y/Y = yellow / bold yellow
k/K = black / bold black
e/W = light grey / white
```sh
nvm set-colors rgBcm
```
#### Persisting custom colors
If you want the custom colors to persist after terminating the shell, export the `NVM_COLORS` variable in your shell profile. For example, if you want to use cyan, magenta, green, bold red and bold yellow, add the following line:
```sh
export NVM_COLORS='cmgRY'
```
#### Suppressing colorized output
`nvm help (or -h or --help)`, `nvm ls`, `nvm ls-remote` and `nvm alias` usually produce colorized output. You can disable colors with the `--no-colors` option (or by setting the environment variable `TERM=dumb`):
```sh
nvm ls --no-colors
nvm help --no-colors
TERM=dumb nvm ls
```
#### Restoring PATH
To restore your PATH, you can deactivate it: To restore your PATH, you can deactivate it:
```sh ```sh
nvm deactivate nvm deactivate
``` ```
#### Set default node version
To set a default Node version to be used in any new shell, use the alias 'default': To set a default Node version to be used in any new shell, use the alias 'default':
```sh ```sh
nvm alias default node nvm alias default node
``` ```
#### Use a mirror of node binaries
To use a mirror of the node binaries, set `$NVM_NODEJS_ORG_MIRROR`: To use a mirror of the node binaries, set `$NVM_NODEJS_ORG_MIRROR`:
```sh ```sh
@@ -341,6 +529,8 @@ $ echo "lts/*" > .nvmrc # to default to the latest LTS version
$ echo "node" > .nvmrc # to default to the latest version $ echo "node" > .nvmrc # to default to the latest version
``` ```
[NB these examples assume a POSIX-compliant shell version of `echo`. If you use a Windows `cmd` development environment, eg the `.nvmrc` file is used to configure a remote Linux deployment, then keep in mind the `"`s will be copied leading to an invalid file. Remove them.]
Then when you run nvm: Then when you run nvm:
```sh ```sh
@@ -355,9 +545,64 @@ The contents of a `.nvmrc` file **must** be the `<version>` (as described by `nv
### Deeper Shell Integration ### Deeper Shell Integration
You can use [`avn`](https://github.com/wbyoung/avn) to deeply integrate into your shell and automatically invoke `nvm` when changing directories. `avn` is **not** supported by the `nvm` development team. Please [report issues to the `avn` team](https://github.com/wbyoung/avn/issues/new). You can use [`avn`](https://github.com/wbyoung/avn) to deeply integrate into your shell and automatically invoke `nvm` when changing directories. `avn` is **not** supported by the `nvm` maintainers. Please [report issues to the `avn` team](https://github.com/wbyoung/avn/issues/new).
If you prefer a lighter-weight solution, the recipes below have been contributed by `nvm` users. They are **not** supported by the `nvm` development team. We are, however, accepting pull requests for more examples. If you prefer a lighter-weight solution, the recipes below have been contributed by `nvm` users. They are **not** supported by the `nvm` maintainers. We are, however, accepting pull requests for more examples.
#### bash
##### Automatically call `nvm use`
Put the following at the end of your `$HOME/.bashrc`:
```bash
cdnvm() {
command cd "$@" || return $?
nvm_path=$(nvm_find_up .nvmrc | tr -d '\n')
# If there are no .nvmrc file, use the default nvm version
if [[ ! $nvm_path = *[^[:space:]]* ]]; then
declare default_version;
default_version=$(nvm version default);
# If there is no default version, set it to `node`
# This will use the latest version on your machine
if [[ $default_version == "N/A" ]]; then
nvm alias default node;
default_version=$(nvm version default);
fi
# If the current version is not the default version, set it to use the default version
if [[ $(nvm current) != "$default_version" ]]; then
nvm use default;
fi
elif [[ -s $nvm_path/.nvmrc && -r $nvm_path/.nvmrc ]]; then
declare nvm_version
nvm_version=$(<"$nvm_path"/.nvmrc)
declare locally_resolved_nvm_version
# `nvm ls` will check all locally-available versions
# If there are multiple matching versions, take the latest one
# Remove the `->` and `*` characters and spaces
# `locally_resolved_nvm_version` will be `N/A` if no local versions are found
locally_resolved_nvm_version=$(nvm ls --no-colors "$nvm_version" | tail -1 | tr -d '\->*' | tr -d '[:space:]')
# If it is not already installed, install it
# `nvm install` will implicitly use the newly-installed version
if [[ "$locally_resolved_nvm_version" == "N/A" ]]; then
nvm install "$nvm_version";
elif [[ $(nvm current) != "$locally_resolved_nvm_version" ]]; then
nvm use "$nvm_version";
fi
fi
}
alias cd='cdnvm'
cd "$PWD"
```
This alias would search 'up' from your current directory in order to detect a `.nvmrc` file. If it finds it, it will switch to that version; if not, it will use the default version.
#### zsh #### zsh
@@ -370,7 +615,6 @@ Put this into your `$HOME/.zshrc` to call `nvm use` automatically whenever you e
# place this after nvm initialization! # place this after nvm initialization!
autoload -U add-zsh-hook autoload -U add-zsh-hook
load-nvmrc() { load-nvmrc() {
local node_version="$(nvm version)"
local nvmrc_path="$(nvm_find_nvmrc)" local nvmrc_path="$(nvm_find_nvmrc)"
if [ -n "$nvmrc_path" ]; then if [ -n "$nvmrc_path" ]; then
@@ -378,10 +622,10 @@ load-nvmrc() {
if [ "$nvmrc_node_version" = "N/A" ]; then if [ "$nvmrc_node_version" = "N/A" ]; then
nvm install nvm install
elif [ "$nvmrc_node_version" != "$node_version" ]; then elif [ "$nvmrc_node_version" != "$(nvm version)" ]; then
nvm use nvm use
fi fi
elif [ "$node_version" != "$(nvm version default)" ]; then elif [ -n "$(PWD=$OLDPWD nvm_find_nvmrc)" ] && [ "$(nvm version)" != "$(nvm version default)" ]; then
echo "Reverting to nvm default version" echo "Reverting to nvm default version"
nvm use default nvm use default
fi fi
@@ -390,20 +634,46 @@ add-zsh-hook chpwd load-nvmrc
load-nvmrc load-nvmrc
``` ```
## License #### fish
nvm is released under the MIT license. ##### Calling `nvm use` automatically in a directory with a `.nvmrc` file
This requires that you have [bass](https://github.com/edc/bass) installed.
```fish
# ~/.config/fish/functions/nvm.fish
function nvm
bass source ~/.nvm/nvm.sh --no-use ';' nvm $argv
end
# ~/.config/fish/functions/nvm_find_nvmrc.fish
function nvm_find_nvmrc
bass source ~/.nvm/nvm.sh --no-use ';' nvm_find_nvmrc
end
Copyright (C) 2010 Tim Caswell and Jordan Harband # ~/.config/fish/functions/load_nvm.fish
function load_nvm --on-variable="PWD"
set -l default_node_version (nvm version default)
set -l node_version (nvm version)
set -l nvmrc_path (nvm_find_nvmrc)
if test -n "$nvmrc_path"
set -l nvmrc_node_version (nvm version (cat $nvmrc_path))
if test "$nvmrc_node_version" = "N/A"
nvm install (cat $nvmrc_path)
else if test "$nvmrc_node_version" != "$node_version"
nvm use $nvmrc_node_version
end
else if test "$node_version" != "$default_node_version"
echo "Reverting to default Node version"
nvm use default
end
end
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: # ~/.config/fish/config.fish
# You must call it on initialization or listening to directory switching won't work
load_nvm > /dev/stderr
```
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. ## Running Tests
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
## Running tests
Tests are written in [Urchin]. Install Urchin (and other dependencies) like so: Tests are written in [Urchin]. Install Urchin (and other dependencies) like so:
npm install npm install
@@ -425,7 +695,20 @@ Run all of the tests like this:
Nota bene: Avoid running nvm while the tests are running. Nota bene: Avoid running nvm while the tests are running.
## Bash completion ## Environment variables
nvm exposes the following environment variables:
- `NVM_DIR` - nvm's installation directory.
- `NVM_BIN` - where node, npm, and global packages for the active version of node are installed.
- `NVM_INC` - node's include file directory (useful for building C/C++ addons for node).
- `NVM_CD_FLAGS` - used to maintain compatibility with zsh.
- `NVM_RC_VERSION` - version from .nvmrc file if being used.
Additionally, nvm modifies `PATH`, and, if present, `MANPATH` and `NODE_PATH` when changing versions.
## Bash Completion
To activate, you need to source `bash_completion`: To activate, you need to source `bash_completion`:
@@ -438,91 +721,115 @@ Put the above sourcing line just below the sourcing line for nvm in your profile
### Usage ### Usage
nvm: nvm:
> $ nvm <kbd>Tab</kbd>
``` > `$ nvm` <kbd>Tab</kbd>
alias deactivate install ls run unload ```sh
clear-cache exec list ls-remote unalias use alias deactivate install list-remote reinstall-packages uninstall version
current help list-remote reinstall-packages uninstall version cache exec install-latest-npm ls run unload version-remote
current help list ls-remote unalias use which
``` ```
nvm alias: nvm alias:
> $ nvm alias <kbd>Tab</kbd>
``` > `$ nvm alias` <kbd>Tab</kbd>
default ```sh
default iojs lts/* lts/argon lts/boron lts/carbon lts/dubnium lts/erbium node stable unstable
``` ```
> $ nvm alias my_alias <kbd>Tab</kbd>
``` > `$ nvm alias my_alias` <kbd>Tab</kbd>
v0.6.21 v0.8.26 v0.10.28 ```sh
v10.22.0 v12.18.3 v14.8.0
``` ```
nvm use: nvm use:
> $ nvm use <kbd>Tab</kbd> > `$ nvm use` <kbd>Tab</kbd>
``` ```
my_alias default v0.6.21 v0.8.26 v0.10.28 my_alias default v10.22.0 v12.18.3 v14.8.0
``` ```
nvm uninstall: nvm uninstall:
> $ nvm uninstall <kbd>Tab</kbd> > `$ nvm uninstall` <kbd>Tab</kbd>
``` ```
my_alias default v0.6.21 v0.8.26 v0.10.28 my_alias default v10.22.0 v12.18.3 v14.8.0
``` ```
## Compatibility Issues ## Compatibility Issues
`nvm` will encounter some issues if you have some non-default settings set. (see [#606](/../../issues/606))
`nvm` will encounter some issues if you have some non-default settings set. (see [#606](https://github.com/creationix/nvm/issues/606))
The following are known to cause issues: The following are known to cause issues:
Inside `~/.npmrc`: Inside `~/.npmrc`:
```sh ```sh
prefix='some/path' prefix='some/path'
``` ```
Environment Variables: Environment Variables:
```sh ```sh
$NPM_CONFIG_PREFIX $NPM_CONFIG_PREFIX
$PREFIX $PREFIX
``` ```
Shell settings: Shell settings:
```sh ```sh
set -e set -e
``` ```
## Installing nvm on Alpine Linux ## Installing nvm on Alpine Linux
In order to provide the best performance (and other optimisations), nvm will download and install pre-compiled binaries for Node (and npm) when you run `nvm install X`. The Node project compiles, tests and hosts/provides pre-these compiled binaries which are built for mainstream/traditional Linux distributions (such as Debian, Ubuntu, CentOS, RedHat et al).
In order to provide the best performance (and other optimizations), nvm will download and install pre-compiled binaries for Node (and npm) when you run `nvm install X`. The Node project compiles, tests and hosts/provides these pre-compiled binaries which are built for mainstream/traditional Linux distributions (such as Debian, Ubuntu, CentOS, RedHat et al).
Alpine Linux, unlike mainstream/traditional Linux distributions, is based on [BusyBox](https://www.busybox.net/), a very compact (~5MB) Linux distribution. BusyBox (and thus Alpine Linux) uses a different C/C++ stack to most mainstream/traditional Linux distributions - [musl](https://www.musl-libc.org/). This makes binary programs built for such mainstream/traditional incompatible with Alpine Linux, thus we cannot simply `nvm install X` on Alpine Linux and expect the downloaded binary to run correctly - you'll likely see "...does not exist" errors if you try that. Alpine Linux, unlike mainstream/traditional Linux distributions, is based on [BusyBox](https://www.busybox.net/), a very compact (~5MB) Linux distribution. BusyBox (and thus Alpine Linux) uses a different C/C++ stack to most mainstream/traditional Linux distributions - [musl](https://www.musl-libc.org/). This makes binary programs built for such mainstream/traditional incompatible with Alpine Linux, thus we cannot simply `nvm install X` on Alpine Linux and expect the downloaded binary to run correctly - you'll likely see "...does not exist" errors if you try that.
There is a `-s` flag for `nvm install` which requests nvm download Node source and compile it locally. There is a `-s` flag for `nvm install` which requests nvm download Node source and compile it locally.
If installing nvm on Alpine Linux *is* still what you want or need to do, you should be able to achieve this by running the following from you Alpine Linux shell: If installing nvm on Alpine Linux *is* still what you want or need to do, you should be able to achieve this by running the following from you Alpine Linux shell, depending on which version you are using:
### Alpine Linux 3.13+
```sh
apk add -U curl bash ca-certificates openssl ncurses coreutils python3 make gcc g++ libgcc linux-headers grep util-linux binutils findutils
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh | bash
```
### Alpine Linux 3.5 - 3.12
```sh ```sh
apk add -U curl bash ca-certificates openssl ncurses coreutils python2 make gcc g++ libgcc linux-headers grep util-linux binutils findutils apk add -U curl bash ca-certificates openssl ncurses coreutils python2 make gcc g++ libgcc linux-headers grep util-linux binutils findutils
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh | bash
``` ```
_Note: Alpine 3.5 can only install NodeJS versions up to v6.9.5, Alpine 3.6 can only install versions up to v6.10.3, Alpine 3.7 installs versions up to v8.9.3, Alpine 3.8 installs versions up to v8.14.0, Alpine 3.9 installs versions up to v10.19.0, Alpine 3.10 installs versions up to v10.24.1, Alpine 3.11 installs versions up to v12.22.6, Alpine 3.12 installs versions up to v12.22.12, Alpine 3.13 & 3.14 install versions up to v14.20.0, Alpine 3.15 & 3.16 install versions up to v16.16.0 (**These are all versions on the main branch**). Alpine 3.5 - 3.12 required the package `python2` to build NodeJS, as they are older versions to build. Alpine 3.13+ requires `python3` to successfully build newer NodeJS versions, but you can use `python2` with Alpine 3.13+ if you need to build versions of node supported in Alpine 3.5 - 3.15, you just need to specify what version of NodeJS you need to install in the package install script._
The Node project has some desire but no concrete plans (due to the overheads of building, testing and support) to offer Alpine-compatible binaries. The Node project has some desire but no concrete plans (due to the overheads of building, testing and support) to offer Alpine-compatible binaries.
As a potential alternative, @mhart (a Node contributor) has some [Docker images for Alpine Linux with Node and optionally, npm, pre-installed](https://github.com/mhart/alpine-node). As a potential alternative, @mhart (a Node contributor) has some [Docker images for Alpine Linux with Node and optionally, npm, pre-installed](https://github.com/mhart/alpine-node).
## Removal <a id="removal"></a>
## Uninstalling / Removal
### Manual Uninstall ### Manual Uninstall
To remove nvm manually, execute the following: To remove `nvm` manually, execute the following:
```sh ```sh
$ rm -rf "$NVM_DIR" $ rm -rf "$NVM_DIR"
``` ```
Edit ~/.bashrc (or other shell resource config) and remove the lines below: Edit `~/.bashrc` (or other shell resource config) and remove the lines below:
```sh ```sh
export NVM_DIR="$HOME/.nvm" export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[[ -r $NVM_DIR/bash_completion ]] && \. $NVM_DIR/bash_completion [[ -r $NVM_DIR/bash_completion ]] && \. $NVM_DIR/bash_completion
``` ```
## Docker for development environment ## Docker For Development Environment
To make the development and testing work easier, we have a Dockerfile for development usage, which is based on Ubuntu 14.04 base image, prepared with essential and useful tools for `nvm` development, to build the docker image of the environment, run the docker command at the root of `nvm` repository: To make the development and testing work easier, we have a Dockerfile for development usage, which is based on Ubuntu 18.04 base image, prepared with essential and useful tools for `nvm` development, to build the docker image of the environment, run the docker command at the root of `nvm` repository:
```sh ```sh
$ docker build -t nvm-dev . $ docker build -t nvm-dev .
@@ -540,7 +847,7 @@ nvm-dev latest 9ca4c57a97d8 7 days ago 6
If you got no error message, now you can easily involve in: If you got no error message, now you can easily involve in:
```sh ```sh
$ docker run -it nvm-dev -h nvm-dev $ docker run -h nvm-dev -it nvm-dev
nvm@nvm-dev:~/.nvm$ nvm@nvm-dev:~/.nvm$
``` ```
@@ -548,16 +855,17 @@ nvm@nvm-dev:~/.nvm$
Please note that it'll take about 8 minutes to build the image and the image size would be about 650MB, so it's not suitable for production usage. Please note that it'll take about 8 minutes to build the image and the image size would be about 650MB, so it's not suitable for production usage.
For more information and documentation about docker, please refer to its official website: For more information and documentation about docker, please refer to its official website:
- https://www.docker.com/ - https://www.docker.com/
- https://docs.docker.com/ - https://docs.docker.com/
## Problems ## Problems
- If you try to install a node version and the installation fails, be sure to delete the node downloads from src (`~/.nvm/src/`) or you might get an error when trying to reinstall them again or you might get an error like the following: - If you try to install a node version and the installation fails, be sure to run `nvm cache clear` to delete cached node downloads, or you might get an error like the following:
curl: (33) HTTP server doesn't seem to support byte ranges. Cannot resume. curl: (33) HTTP server doesn't seem to support byte ranges. Cannot resume.
- Where's my `sudo node`? Check out [#43](https://github.com/creationix/nvm/issues/43) - Where's my `sudo node`? Check out [#43](https://github.com/nvm-sh/nvm/issues/43)
- After the v0.8.6 release of node, nvm tries to install from binary packages. But in some systems, the official binary packages don't work due to incompatibility of shared libs. In such cases, use `-s` option to force install from source: - After the v0.8.6 release of node, nvm tries to install from binary packages. But in some systems, the official binary packages don't work due to incompatibility of shared libs. In such cases, use `-s` option to force install from source:
@@ -565,9 +873,9 @@ For more information and documentation about docker, please refer to its officia
nvm install -s 0.8.6 nvm install -s 0.8.6
``` ```
- If setting the `default` alias does not establish the node version in new shells (i.e. `nvm current` yields `system`), ensure that the system's node `PATH` is set before the `nvm.sh` source line in your shell profile (see [#658](https://github.com/creationix/nvm/issues/658)) - If setting the `default` alias does not establish the node version in new shells (i.e. `nvm current` yields `system`), ensure that the system's node `PATH` is set before the `nvm.sh` source line in your shell profile (see [#658](https://github.com/nvm-sh/nvm/issues/658))
## Mac OS "troubleshooting" ## macOS Troubleshooting
**nvm node version not found in vim shell** **nvm node version not found in vim shell**
@@ -579,9 +887,109 @@ sudo chmod ugo-x /usr/libexec/path_helper
More on this issue in [dotphiles/dotzsh](https://github.com/dotphiles/dotzsh#mac-os-x). More on this issue in [dotphiles/dotzsh](https://github.com/dotphiles/dotzsh#mac-os-x).
[1]: https://github.com/creationix/nvm.git **nvm is not compatible with the npm config "prefix" option**
[2]: https://github.com/creationix/nvm/blob/v0.33.11/install.sh
[3]: https://travis-ci.org/creationix/nvm Some solutions for this issue can be found [here](https://github.com/nvm-sh/nvm/issues/1245)
[4]: https://github.com/creationix/nvm/releases/tag/v0.33.11
There is one more edge case causing this issue, and that's a **mismatch between the `$HOME` path and the user's home directory's actual name**.
You have to make sure that the user directory name in `$HOME` and the user directory name you'd see from running `ls /Users/` **are capitalized the same way** ([See this issue](https://github.com/nvm-sh/nvm/issues/2261)).
To change the user directory and/or account name follow the instructions [here](https://support.apple.com/en-us/HT201548)
[1]: https://github.com/nvm-sh/nvm.git
[2]: https://github.com/nvm-sh/nvm/blob/v0.39.2/install.sh
[3]: https://travis-ci.org/nvm-sh/nvm
[4]: https://github.com/nvm-sh/nvm/releases/tag/v0.39.2
[Urchin]: https://github.com/scraperwiki/urchin [Urchin]: https://github.com/scraperwiki/urchin
[Fish]: http://fishshell.com [Fish]: https://fishshell.com
**Homebrew makes zsh directories unsecure**
```shell
zsh compinit: insecure directories, run compaudit for list.
Ignore insecure directories and continue [y] or abort compinit [n]? y
```
Homebrew causes insecure directories like `/usr/local/share/zsh/site-functions` and `/usr/local/share/zsh`. This is **not** an `nvm` problem - it is a homebrew problem. Refer [here](https://github.com/zsh-users/zsh-completions/issues/680) for some solutions related to the issue.
**Macs with M1 chip**
Experimental support for the M1 architecture was added in node.js v15.3 and full support was added in v16.0.
Because of this, if you try to install older versions of node as usual, you will probably experience either compilation errors when installing node or out-of-memory errors while running your code.
So, if you want to run a version prior to v16.0 on an M1 Mac, it may be best to compile node targeting the `x86_64` Intel architecture so that Rosetta 2 can translate the `x86_64` processor instructions to ARM-based Apple Silicon instructions.
Here's what you will need to do:
- Install Rosetta, if you haven't already done so
```sh
$ softwareupdate --install-rosetta
```
You might wonder, "how will my M1 Mac know to use Rosetta for a version of node compiled for an Intel chip?".
If an executable contains only Intel instructions, macOS will automatically use Rosetta to translate the instructions.
- Open a shell that's running using Rosetta
```sh
$ arch -x86_64 zsh
```
Note: This same thing can also be accomplished by finding the Terminal or iTerm App in Finder, right clicking, selecting "Get Info", and then checking the box labeled "Open using Rosetta".
Note: This terminal session is now running in `zsh`.
If `zsh` is not the shell you typically use, `nvm` may not be `source`'d automatically like it probably is for your usual shell through your dotfiles.
If that's the case, make sure to source `nvm`.
```sh
$ source "${NVM_DIR}/nvm.sh"
```
- Install whatever older version of node you are interested in. Let's use 12.22.1 as an example.
This will fetch the node source code and compile it, which will take several minutes.
```sh
$ nvm install v12.22.1 --shared-zlib
```
Note: You're probably curious why `--shared-zlib` is included.
There's a bug in recent versions of Apple's system `clang` compiler.
If one of these broken versions is installed on your system, the above step will likely still succeed even if you didn't include the `--shared-zlib` flag.
However, later, when you attempt to `npm install` something using your old version of node.js, you will see `incorrect data check` errors.
If you want to avoid the possible hassle of dealing with this, include that flag.
For more details, see [this issue](https://github.com/nodejs/node/issues/39313) and [this comment](https://github.com/nodejs/node/issues/39313#issuecomment-902395576)
- Exit back to your native shell.
```sh
$ exit
$ arch
arm64
```
Note: If you selected the box labeled "Open using Rosetta" rather than running the CLI command in the second step, you will see `i386` here.
Unless you have another reason to have that box selected, you can deselect it now.
- Check to make sure the architecture is correct. `x64` is the abbreviation for `x86_64`, which is what you want to see.
```sh
$ node -p process.arch
x64
```
Now you should be able to use node as usual.
## Maintainers
Currently, the sole maintainer is [@ljharb](https://github.com/ljharb) - more maintainers are quite welcome, and we hope to add folks to the team over time. [Governance](./GOVERNANCE.md) will be re-evaluated as the project evolves.
## License
See [LICENSE.md](./LICENSE.md).
## Copyright notice
Copyright [OpenJS Foundation](https://openjsf.org) and `nvm` contributors. All rights reserved. The [OpenJS Foundation](https://openjsf.org) has registered trademarks and uses trademarks. For a list of trademarks of the [OpenJS Foundation](https://openjsf.org), please see our [Trademark Policy](https://trademark-policy.openjsf.org/) and [Trademark List](https://trademark-list.openjsf.org/). Node.js is a trademark of Joyent, Inc. and is used with its permission. Trademarks and logos not indicated on the [list of OpenJS Foundation trademarks](https://trademark-list.openjsf.org) are trademarks™ or registered® trademarks of their respective holders. Use of them does not imply any affiliation with or endorsement by them.
[The OpenJS Foundation](https://openjsf.org/) | [Terms of Use](https://terms-of-use.openjsf.org/) | [Privacy Policy](https://privacy-policy.openjsf.org/) | [OpenJS Foundation Bylaws](https://bylaws.openjsf.org/) | [Trademark Policy](https://trademark-policy.openjsf.org/) | [Trademark List](https://trademark-list.openjsf.org/) | [Cookie Policy](https://www.linuxfoundation.org/cookies/)

View File

@@ -2,8 +2,8 @@
This is a list of the primary features planned for `nvm`: This is a list of the primary features planned for `nvm`:
- [x] Rewriting installation code paths to support installing `io.js` and `node` `v4+` [from source](https://github.com/creationix/nvm/issues/1188). - [x] Rewriting installation code paths to support installing `io.js` and `node` `v4+` [from source](https://github.com/nvm-sh/nvm/issues/1188).
- This will include [reusing previously downloaded tarballs](https://github.com/creationix/nvm/issues/1193) that match checksums, which is a nice performance and bandwidth bonus. - This will include [reusing previously downloaded tarballs](https://github.com/nvm-sh/nvm/issues/1193) that match checksums, which is a nice performance and bandwidth bonus.
- [ ] Adding opt-in environment variable support to list, download, and install `node` [release candidates](https://github.com/creationix/nvm/issues/779), and [nightly builds](https://github.com/creationix/nvm/issues/1053). - [ ] Adding opt-in environment variable support to list, download, and install `node` [release candidates](https://github.com/nvm-sh/nvm/issues/779), and [nightly builds](https://github.com/nvm-sh/nvm/issues/1053).
- [ ] [`nvm update`](https://github.com/creationix/nvm/issues/400): the ability to autoupdate `nvm` itself - [ ] [`nvm update`](https://github.com/nvm-sh/nvm/issues/400): the ability to autoupdate `nvm` itself
- [ ] [v1.0.0](https://github.com/creationix/nvm/milestone/1), including updating the [nvm on npm](https://github.com/creationix/nvm/issues/304) to auto-install nvm properly - [ ] [v1.0.0](https://github.com/nvm-sh/nvm/milestone/1), including updating the [nvm on npm](https://github.com/nvm-sh/nvm/issues/304) to auto-install nvm properly

View File

@@ -6,17 +6,15 @@ if ! command -v nvm &> /dev/null; then
return return
fi fi
__nvm_generate_completion() __nvm_generate_completion() {
{
declare current_word declare current_word
current_word="${COMP_WORDS[COMP_CWORD]}" current_word="${COMP_WORDS[COMP_CWORD]}"
# shellcheck disable=SC2207 # shellcheck disable=SC2207
COMPREPLY=($(compgen -W "$1" -- "$current_word")) COMPREPLY=($(compgen -W "$1" -- "${current_word}"))
return 0 return 0
} }
__nvm_commands () __nvm_commands() {
{
declare current_word declare current_word
declare command declare command
@@ -32,7 +30,7 @@ __nvm_commands ()
if [ ${#COMP_WORDS[@]} == 4 ]; then if [ ${#COMP_WORDS[@]} == 4 ]; then
command="${COMP_WORDS[COMP_CWORD-2]}" command="${COMP_WORDS[COMP_CWORD - 2]}"
case "${command}" in case "${command}" in
alias) __nvm_installed_nodes ;; alias) __nvm_installed_nodes ;;
esac esac
@@ -41,46 +39,41 @@ __nvm_commands ()
case "${current_word}" in case "${current_word}" in
-*) __nvm_options ;; -*) __nvm_options ;;
*) __nvm_generate_completion "$COMMANDS" ;; *) __nvm_generate_completion "${COMMANDS}" ;;
esac esac
fi fi
} }
__nvm_options () __nvm_options() {
{
OPTIONS='' OPTIONS=''
__nvm_generate_completion "$OPTIONS" __nvm_generate_completion "${OPTIONS}"
} }
__nvm_installed_nodes () __nvm_installed_nodes() {
{
__nvm_generate_completion "$(nvm_ls) $(__nvm_aliases)" __nvm_generate_completion "$(nvm_ls) $(__nvm_aliases)"
} }
__nvm_aliases () __nvm_aliases() {
{
declare aliases declare aliases
aliases="" aliases=""
if [ -d "$NVM_DIR/alias" ]; then if [ -d "${NVM_DIR}/alias" ]; then
aliases="$(cd "$NVM_DIR/alias" && command find "$PWD" -type f | command sed "s:$PWD/::")" aliases="$(command cd "${NVM_DIR}/alias" && command find "${PWD}" -type f | command sed "s:${PWD}/::")"
fi fi
echo "${aliases} node stable unstable iojs" echo "${aliases} node stable unstable iojs"
} }
__nvm_alias () __nvm_alias() {
{
__nvm_generate_completion "$(__nvm_aliases)" __nvm_generate_completion "$(__nvm_aliases)"
} }
__nvm () __nvm() {
{
declare previous_word declare previous_word
previous_word="${COMP_WORDS[COMP_CWORD-1]}" previous_word="${COMP_WORDS[COMP_CWORD - 1]}"
case "$previous_word" in case "${previous_word}" in
use|run|exec|ls|list|uninstall) __nvm_installed_nodes ;; use | run | exec | ls | list | uninstall) __nvm_installed_nodes ;;
alias|unalias) __nvm_alias ;; alias | unalias) __nvm_alias ;;
*) __nvm_commands ;; *) __nvm_commands ;;
esac esac
@@ -91,8 +84,16 @@ __nvm ()
# called bashcompinit that will create a complete in ZSH. If the user is in # called bashcompinit that will create a complete in ZSH. If the user is in
# ZSH, load and run bashcompinit before calling the complete function. # ZSH, load and run bashcompinit before calling the complete function.
if [[ -n ${ZSH_VERSION-} ]]; then if [[ -n ${ZSH_VERSION-} ]]; then
# First calling compinit (only if not called yet!)
# and then bashcompinit as mentioned by zsh man page.
if ! command -v compinit > /dev/null; then
autoload -U +X compinit && if [[ ${ZSH_DISABLE_COMPFIX-} = true ]]; then
compinit -u
else
compinit
fi
fi
autoload -U +X bashcompinit && bashcompinit autoload -U +X bashcompinit && bashcompinit
autoload -U +X compinit && compinit
fi fi
complete -o default -F __nvm nvm complete -o default -F __nvm nvm

View File

@@ -6,19 +6,41 @@ nvm_has() {
type "$1" > /dev/null 2>&1 type "$1" > /dev/null 2>&1
} }
nvm_echo() {
command printf %s\\n "$*" 2>/dev/null
}
if [ -z "${BASH_VERSION}" ] || [ -n "${ZSH_VERSION}" ]; then
# shellcheck disable=SC2016
nvm_echo >&2 'Error: the install instructions explicitly say to pipe the install script to `bash`; please follow them'
exit 1
fi
nvm_grep() {
GREP_OPTIONS='' command grep "$@"
}
nvm_default_install_dir() {
[ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm"
}
nvm_install_dir() { nvm_install_dir() {
command printf %s "${NVM_DIR:-"$HOME/.nvm"}" if [ -n "$NVM_DIR" ]; then
printf %s "${NVM_DIR}"
else
nvm_default_install_dir
fi
} }
nvm_latest_version() { nvm_latest_version() {
echo "v0.33.11" nvm_echo "v0.39.2"
} }
nvm_profile_is_bash_or_zsh() { nvm_profile_is_bash_or_zsh() {
local TEST_PROFILE local TEST_PROFILE
TEST_PROFILE="${1-}" TEST_PROFILE="${1-}"
case "${TEST_PROFILE-}" in case "${TEST_PROFILE-}" in
*"/.bashrc" | *"/.bash_profile" | *"/.zshrc") *"/.bashrc" | *"/.bash_profile" | *"/.zshrc" | *"/.zprofile")
return return
;; ;;
*) *)
@@ -34,44 +56,50 @@ nvm_profile_is_bash_or_zsh() {
# NVM_SOURCE always takes precedence unless the method is "script-nvm-exec" # NVM_SOURCE always takes precedence unless the method is "script-nvm-exec"
# #
nvm_source() { nvm_source() {
local NVM_GITHUB_REPO
NVM_GITHUB_REPO="${NVM_INSTALL_GITHUB_REPO:-nvm-sh/nvm}"
local NVM_VERSION
NVM_VERSION="${NVM_INSTALL_VERSION:-$(nvm_latest_version)}"
local NVM_METHOD local NVM_METHOD
NVM_METHOD="$1" NVM_METHOD="$1"
local NVM_SOURCE_URL local NVM_SOURCE_URL
NVM_SOURCE_URL="$NVM_SOURCE" NVM_SOURCE_URL="$NVM_SOURCE"
if [ "_$NVM_METHOD" = "_script-nvm-exec" ]; then if [ "_$NVM_METHOD" = "_script-nvm-exec" ]; then
NVM_SOURCE_URL="https://raw.githubusercontent.com/creationix/nvm/$(nvm_latest_version)/nvm-exec" NVM_SOURCE_URL="https://raw.githubusercontent.com/${NVM_GITHUB_REPO}/${NVM_VERSION}/nvm-exec"
elif [ "_$NVM_METHOD" = "_script-nvm-bash-completion" ]; then elif [ "_$NVM_METHOD" = "_script-nvm-bash-completion" ]; then
NVM_SOURCE_URL="https://raw.githubusercontent.com/creationix/nvm/$(nvm_latest_version)/bash_completion" NVM_SOURCE_URL="https://raw.githubusercontent.com/${NVM_GITHUB_REPO}/${NVM_VERSION}/bash_completion"
elif [ -z "$NVM_SOURCE_URL" ]; then elif [ -z "$NVM_SOURCE_URL" ]; then
if [ "_$NVM_METHOD" = "_script" ]; then if [ "_$NVM_METHOD" = "_script" ]; then
NVM_SOURCE_URL="https://raw.githubusercontent.com/creationix/nvm/$(nvm_latest_version)/nvm.sh" NVM_SOURCE_URL="https://raw.githubusercontent.com/${NVM_GITHUB_REPO}/${NVM_VERSION}/nvm.sh"
elif [ "_$NVM_METHOD" = "_git" ] || [ -z "$NVM_METHOD" ]; then elif [ "_$NVM_METHOD" = "_git" ] || [ -z "$NVM_METHOD" ]; then
NVM_SOURCE_URL="https://github.com/creationix/nvm.git" NVM_SOURCE_URL="https://github.com/${NVM_GITHUB_REPO}.git"
else else
echo >&2 "Unexpected value \"$NVM_METHOD\" for \$NVM_METHOD" nvm_echo >&2 "Unexpected value \"$NVM_METHOD\" for \$NVM_METHOD"
return 1 return 1
fi fi
fi fi
echo "$NVM_SOURCE_URL" nvm_echo "$NVM_SOURCE_URL"
} }
# #
# Node.js version to install # Node.js version to install
# #
nvm_node_version() { nvm_node_version() {
echo "$NODE_VERSION" nvm_echo "$NODE_VERSION"
} }
nvm_download() { nvm_download() {
if nvm_has "curl"; then if nvm_has "curl"; then
curl --compressed -q "$@" curl --fail --compressed -q "$@"
elif nvm_has "wget"; then elif nvm_has "wget"; then
# Emulate curl with wget # Emulate curl with wget
ARGS=$(echo "$*" | command sed -e 's/--progress-bar /--progress=bar /' \ ARGS=$(nvm_echo "$@" | command sed -e 's/--progress-bar /--progress=bar /' \
-e 's/-L //' \
-e 's/--compressed //' \ -e 's/--compressed //' \
-e 's/--fail //' \
-e 's/-L //' \
-e 's/-I /--server-response /' \ -e 's/-I /--server-response /' \
-e 's/-s /-q /' \ -e 's/-s /-q /' \
-e 's/-sS /-nv /' \
-e 's/-o /-O /' \ -e 's/-o /-O /' \
-e 's/-C - /-c /') -e 's/-C - /-c /')
# shellcheck disable=SC2086 # shellcheck disable=SC2086
@@ -82,56 +110,76 @@ nvm_download() {
install_nvm_from_git() { install_nvm_from_git() {
local INSTALL_DIR local INSTALL_DIR
INSTALL_DIR="$(nvm_install_dir)" INSTALL_DIR="$(nvm_install_dir)"
local NVM_VERSION
if [ -d "$INSTALL_DIR/.git" ]; then NVM_VERSION="${NVM_INSTALL_VERSION:-$(nvm_latest_version)}"
echo "=> nvm is already installed in $INSTALL_DIR, trying to update using git" if [ -n "${NVM_INSTALL_VERSION:-}" ]; then
command printf '\r=> ' # Check if version is an existing ref
command git --git-dir="$INSTALL_DIR"/.git --work-tree="$INSTALL_DIR" fetch origin tag "$(nvm_latest_version)" --depth=1 2> /dev/null || { if command git ls-remote "$(nvm_source "git")" "$NVM_VERSION" | nvm_grep -q "$NVM_VERSION" ; then
echo >&2 "Failed to update nvm, run 'git fetch' in $INSTALL_DIR yourself." :
# Check if version is an existing changeset
elif ! nvm_download -o /dev/null "$(nvm_source "script-nvm-exec")"; then
nvm_echo >&2 "Failed to find '$NVM_VERSION' version."
exit 1 exit 1
} fi
fi
local fetch_error
if [ -d "$INSTALL_DIR/.git" ]; then
# Updating repo
nvm_echo "=> nvm is already installed in $INSTALL_DIR, trying to update using git"
command printf '\r=> '
fetch_error="Failed to update nvm with $NVM_VERSION, run 'git fetch' in $INSTALL_DIR yourself."
else else
# Cloning to $INSTALL_DIR fetch_error="Failed to fetch origin with $NVM_VERSION. Please report this!"
echo "=> Downloading nvm from git to '$INSTALL_DIR'" nvm_echo "=> Downloading nvm from git to '$INSTALL_DIR'"
command printf '\r=> ' command printf '\r=> '
mkdir -p "${INSTALL_DIR}" mkdir -p "${INSTALL_DIR}"
if [ "$(ls -A "${INSTALL_DIR}")" ]; then if [ "$(ls -A "${INSTALL_DIR}")" ]; then
# Initializing repo
command git init "${INSTALL_DIR}" || { command git init "${INSTALL_DIR}" || {
echo >&2 'Failed to initialize nvm repo. Please report this!' nvm_echo >&2 'Failed to initialize nvm repo. Please report this!'
exit 2 exit 2
} }
command git --git-dir="${INSTALL_DIR}/.git" remote add origin "$(nvm_source)" 2> /dev/null \ command git --git-dir="${INSTALL_DIR}/.git" remote add origin "$(nvm_source)" 2> /dev/null \
|| command git --git-dir="${INSTALL_DIR}/.git" remote set-url origin "$(nvm_source)" || { || command git --git-dir="${INSTALL_DIR}/.git" remote set-url origin "$(nvm_source)" || {
echo >&2 'Failed to add remote "origin" (or set the URL). Please report this!' nvm_echo >&2 'Failed to add remote "origin" (or set the URL). Please report this!'
exit 2
}
command git --git-dir="${INSTALL_DIR}/.git" fetch origin tag "$(nvm_latest_version)" --depth=1 || {
echo >&2 'Failed to fetch origin with tags. Please report this!'
exit 2 exit 2
} }
else else
command git -c advice.detachedHead=false clone "$(nvm_source)" -b "$(nvm_latest_version)" --depth=1 "${INSTALL_DIR}" || { # Cloning repo
echo >&2 'Failed to clone nvm repo. Please report this!' command git clone "$(nvm_source)" --depth=1 "${INSTALL_DIR}" || {
nvm_echo >&2 'Failed to clone nvm repo. Please report this!'
exit 2 exit 2
} }
fi fi
fi fi
command git -c advice.detachedHead=false --git-dir="$INSTALL_DIR"/.git --work-tree="$INSTALL_DIR" checkout -f --quiet "$(nvm_latest_version)" # Try to fetch tag
if [ ! -z "$(command git --git-dir="$INSTALL_DIR"/.git --work-tree="$INSTALL_DIR" show-ref refs/heads/master)" ]; then if command git --git-dir="$INSTALL_DIR"/.git --work-tree="$INSTALL_DIR" fetch origin tag "$NVM_VERSION" --depth=1 2>/dev/null; then
if command git --git-dir="$INSTALL_DIR"/.git --work-tree="$INSTALL_DIR" branch --quiet 2>/dev/null; then :
command git --git-dir="$INSTALL_DIR"/.git --work-tree="$INSTALL_DIR" branch --quiet -D master >/dev/null 2>&1 # Fetch given version
elif ! command git --git-dir="$INSTALL_DIR"/.git --work-tree="$INSTALL_DIR" fetch origin "$NVM_VERSION" --depth=1; then
nvm_echo >&2 "$fetch_error"
exit 1
fi
command git -c advice.detachedHead=false --git-dir="$INSTALL_DIR"/.git --work-tree="$INSTALL_DIR" checkout -f --quiet FETCH_HEAD || {
nvm_echo >&2 "Failed to checkout the given version $NVM_VERSION. Please report this!"
exit 2
}
if [ -n "$(command git --git-dir="$INSTALL_DIR"/.git --work-tree="$INSTALL_DIR" show-ref refs/heads/master)" ]; then
if command git --no-pager --git-dir="$INSTALL_DIR"/.git --work-tree="$INSTALL_DIR" branch --quiet 2>/dev/null; then
command git --no-pager --git-dir="$INSTALL_DIR"/.git --work-tree="$INSTALL_DIR" branch --quiet -D master >/dev/null 2>&1
else else
echo >&2 "Your version of git is out of date. Please update it!" nvm_echo >&2 "Your version of git is out of date. Please update it!"
command git --git-dir="$INSTALL_DIR"/.git --work-tree="$INSTALL_DIR" branch -D master >/dev/null 2>&1 command git --no-pager --git-dir="$INSTALL_DIR"/.git --work-tree="$INSTALL_DIR" branch -D master >/dev/null 2>&1
fi fi
fi fi
echo "=> Compressing and cleaning up git repository" nvm_echo "=> Compressing and cleaning up git repository"
if ! command git --git-dir="$INSTALL_DIR"/.git --work-tree="$INSTALL_DIR" reflog expire --expire=now --all; then if ! command git --git-dir="$INSTALL_DIR"/.git --work-tree="$INSTALL_DIR" reflog expire --expire=now --all; then
echo >&2 "Your version of git is out of date. Please update it!" nvm_echo >&2 "Your version of git is out of date. Please update it!"
fi fi
if ! command git --git-dir="$INSTALL_DIR"/.git --work-tree="$INSTALL_DIR" gc --auto --aggressive --prune=now ; then if ! command git --git-dir="$INSTALL_DIR"/.git --work-tree="$INSTALL_DIR" gc --auto --aggressive --prune=now ; then
echo >&2 "Your version of git is out of date. Please update it!" nvm_echo >&2 "Your version of git is out of date. Please update it!"
fi fi
return return
} }
@@ -147,15 +195,15 @@ nvm_install_node() {
return 0 return 0
fi fi
echo "=> Installing Node.js version $NODE_VERSION_LOCAL" nvm_echo "=> Installing Node.js version $NODE_VERSION_LOCAL"
nvm install "$NODE_VERSION_LOCAL" nvm install "$NODE_VERSION_LOCAL"
local CURRENT_NVM_NODE local CURRENT_NVM_NODE
CURRENT_NVM_NODE="$(nvm_version current)" CURRENT_NVM_NODE="$(nvm_version current)"
if [ "$(nvm_version "$NODE_VERSION_LOCAL")" == "$CURRENT_NVM_NODE" ]; then if [ "$(nvm_version "$NODE_VERSION_LOCAL")" == "$CURRENT_NVM_NODE" ]; then
echo "=> Node.js version $NODE_VERSION_LOCAL has been successfully installed" nvm_echo "=> Node.js version $NODE_VERSION_LOCAL has been successfully installed"
else else
echo >&2 "Failed to install Node.js $NODE_VERSION_LOCAL" nvm_echo >&2 "Failed to install Node.js $NODE_VERSION_LOCAL"
fi fi
} }
@@ -172,20 +220,20 @@ install_nvm_as_script() {
# Downloading to $INSTALL_DIR # Downloading to $INSTALL_DIR
mkdir -p "$INSTALL_DIR" mkdir -p "$INSTALL_DIR"
if [ -f "$INSTALL_DIR/nvm.sh" ]; then if [ -f "$INSTALL_DIR/nvm.sh" ]; then
echo "=> nvm is already installed in $INSTALL_DIR, trying to update the script" nvm_echo "=> nvm is already installed in $INSTALL_DIR, trying to update the script"
else else
echo "=> Downloading nvm as script to '$INSTALL_DIR'" nvm_echo "=> Downloading nvm as script to '$INSTALL_DIR'"
fi fi
nvm_download -s "$NVM_SOURCE_LOCAL" -o "$INSTALL_DIR/nvm.sh" || { nvm_download -s "$NVM_SOURCE_LOCAL" -o "$INSTALL_DIR/nvm.sh" || {
echo >&2 "Failed to download '$NVM_SOURCE_LOCAL'" nvm_echo >&2 "Failed to download '$NVM_SOURCE_LOCAL'"
return 1 return 1
} & } &
nvm_download -s "$NVM_EXEC_SOURCE" -o "$INSTALL_DIR/nvm-exec" || { nvm_download -s "$NVM_EXEC_SOURCE" -o "$INSTALL_DIR/nvm-exec" || {
echo >&2 "Failed to download '$NVM_EXEC_SOURCE'" nvm_echo >&2 "Failed to download '$NVM_EXEC_SOURCE'"
return 2 return 2
} & } &
nvm_download -s "$NVM_BASH_COMPLETION_SOURCE" -o "$INSTALL_DIR/bash_completion" || { nvm_download -s "$NVM_BASH_COMPLETION_SOURCE" -o "$INSTALL_DIR/bash_completion" || {
echo >&2 "Failed to download '$NVM_BASH_COMPLETION_SOURCE'" nvm_echo >&2 "Failed to download '$NVM_BASH_COMPLETION_SOURCE'"
return 2 return 2
} & } &
for job in $(jobs -p | command sort) for job in $(jobs -p | command sort)
@@ -193,7 +241,7 @@ install_nvm_as_script() {
wait "$job" || return $? wait "$job" || return $?
done done
chmod a+x "$INSTALL_DIR/nvm-exec" || { chmod a+x "$INSTALL_DIR/nvm-exec" || {
echo >&2 "Failed to mark '$INSTALL_DIR/nvm-exec' as executable" nvm_echo >&2 "Failed to mark '$INSTALL_DIR/nvm-exec' as executable"
return 3 return 3
} }
} }
@@ -202,7 +250,7 @@ nvm_try_profile() {
if [ -z "${1-}" ] || [ ! -f "${1}" ]; then if [ -z "${1-}" ] || [ ! -f "${1}" ]; then
return 1 return 1
fi fi
echo "${1}" nvm_echo "${1}"
} }
# #
@@ -212,26 +260,35 @@ nvm_try_profile() {
# Otherwise, an empty string is returned # Otherwise, an empty string is returned
# #
nvm_detect_profile() { nvm_detect_profile() {
if [ "${PROFILE-}" = '/dev/null' ]; then
# the user has specifically requested NOT to have nvm touch their profile
return
fi
if [ -n "${PROFILE}" ] && [ -f "${PROFILE}" ]; then if [ -n "${PROFILE}" ] && [ -f "${PROFILE}" ]; then
echo "${PROFILE}" nvm_echo "${PROFILE}"
return return
fi fi
local DETECTED_PROFILE local DETECTED_PROFILE
DETECTED_PROFILE='' DETECTED_PROFILE=''
if [ -n "${BASH_VERSION-}" ]; then if [ "${SHELL#*bash}" != "$SHELL" ]; then
if [ -f "$HOME/.bashrc" ]; then if [ -f "$HOME/.bashrc" ]; then
DETECTED_PROFILE="$HOME/.bashrc" DETECTED_PROFILE="$HOME/.bashrc"
elif [ -f "$HOME/.bash_profile" ]; then elif [ -f "$HOME/.bash_profile" ]; then
DETECTED_PROFILE="$HOME/.bash_profile" DETECTED_PROFILE="$HOME/.bash_profile"
fi fi
elif [ -n "${ZSH_VERSION-}" ]; then elif [ "${SHELL#*zsh}" != "$SHELL" ]; then
if [ -f "$HOME/.zshrc" ]; then
DETECTED_PROFILE="$HOME/.zshrc" DETECTED_PROFILE="$HOME/.zshrc"
elif [ -f "$HOME/.zprofile" ]; then
DETECTED_PROFILE="$HOME/.zprofile"
fi
fi fi
if [ -z "$DETECTED_PROFILE" ]; then if [ -z "$DETECTED_PROFILE" ]; then
for EACH_PROFILE in ".profile" ".bashrc" ".bash_profile" ".zshrc" for EACH_PROFILE in ".profile" ".bashrc" ".bash_profile" ".zprofile" ".zshrc"
do do
if DETECTED_PROFILE="$(nvm_try_profile "${HOME}/${EACH_PROFILE}")"; then if DETECTED_PROFILE="$(nvm_try_profile "${HOME}/${EACH_PROFILE}")"; then
break break
@@ -239,8 +296,8 @@ nvm_detect_profile() {
done done
fi fi
if [ ! -z "$DETECTED_PROFILE" ]; then if [ -n "$DETECTED_PROFILE" ]; then
echo "$DETECTED_PROFILE" nvm_echo "$DETECTED_PROFILE"
fi fi
} }
@@ -249,7 +306,9 @@ nvm_detect_profile() {
# Node, and warn them if so. # Node, and warn them if so.
# #
nvm_check_global_modules() { nvm_check_global_modules() {
command -v npm >/dev/null 2>&1 || return 0 local NPM_COMMAND
NPM_COMMAND="$(command -v npm 2>/dev/null)" || return 0
[ -n "${NVM_DIR}" ] && [ -z "${NPM_COMMAND%%"$NVM_DIR"/*}" ] && return 0
local NPM_VERSION local NPM_VERSION
NPM_VERSION="$(npm --version)" NPM_VERSION="$(npm --version)"
@@ -271,56 +330,76 @@ nvm_check_global_modules() {
if [ "${MODULE_COUNT}" != '0' ]; then if [ "${MODULE_COUNT}" != '0' ]; then
# shellcheck disable=SC2016 # shellcheck disable=SC2016
echo '=> You currently have modules installed globally with `npm`. These will no' nvm_echo '=> You currently have modules installed globally with `npm`. These will no'
# shellcheck disable=SC2016 # shellcheck disable=SC2016
echo '=> longer be linked to the active version of Node when you install a new node' nvm_echo '=> longer be linked to the active version of Node when you install a new node'
# shellcheck disable=SC2016 # shellcheck disable=SC2016
echo '=> with `nvm`; and they may (depending on how you construct your `$PATH`)' nvm_echo '=> with `nvm`; and they may (depending on how you construct your `$PATH`)'
# shellcheck disable=SC2016 # shellcheck disable=SC2016
echo '=> override the binaries of modules installed with `nvm`:' nvm_echo '=> override the binaries of modules installed with `nvm`:'
echo nvm_echo
command printf %s\\n "$NPM_GLOBAL_MODULES" command printf %s\\n "$NPM_GLOBAL_MODULES"
echo '=> If you wish to uninstall them at a later point (or re-install them under your' nvm_echo '=> If you wish to uninstall them at a later point (or re-install them under your'
# shellcheck disable=SC2016 # shellcheck disable=SC2016
echo '=> `nvm` Nodes), you can remove them from the system Node as follows:' nvm_echo '=> `nvm` Nodes), you can remove them from the system Node as follows:'
echo nvm_echo
echo ' $ nvm use system' nvm_echo ' $ nvm use system'
echo ' $ npm uninstall -g a_module' nvm_echo ' $ npm uninstall -g a_module'
echo nvm_echo
fi fi
} }
nvm_do_install() { nvm_do_install() {
if [ -n "${NVM_DIR-}" ] && ! [ -d "${NVM_DIR}" ]; then if [ -n "${NVM_DIR-}" ] && ! [ -d "${NVM_DIR}" ]; then
echo >&2 "You have \$NVM_DIR set to \"${NVM_DIR}\", but that directory does not exist. Check your profile files and environment." if [ -e "${NVM_DIR}" ]; then
nvm_echo >&2 "File \"${NVM_DIR}\" has the same name as installation directory."
exit 1
fi
if [ "${NVM_DIR}" = "$(nvm_default_install_dir)" ]; then
mkdir "${NVM_DIR}"
else
nvm_echo >&2 "You have \$NVM_DIR set to \"${NVM_DIR}\", but that directory does not exist. Check your profile files and environment."
exit 1
fi
fi
# Disable the optional which check, https://www.shellcheck.net/wiki/SC2230
# shellcheck disable=SC2230
if nvm_has xcode-select && [ "$(xcode-select -p >/dev/null 2>/dev/null ; echo $?)" = '2' ] && [ "$(which git)" = '/usr/bin/git' ] && [ "$(which curl)" = '/usr/bin/curl' ]; then
nvm_echo >&2 'You may be on a Mac, and need to install the Xcode Command Line Developer Tools.'
# shellcheck disable=SC2016
nvm_echo >&2 'If so, run `xcode-select --install` and try again. If not, please report this!'
exit 1 exit 1
fi fi
if [ -z "${METHOD}" ]; then if [ -z "${METHOD}" ]; then
# Autodetect install method # Autodetect install method
if nvm_has git; then if nvm_has git; then
install_nvm_from_git install_nvm_from_git
elif nvm_has nvm_download; then elif nvm_has curl || nvm_has wget; then
install_nvm_as_script install_nvm_as_script
else else
echo >&2 'You need git, curl, or wget to install nvm' nvm_echo >&2 'You need git, curl, or wget to install nvm'
exit 1 exit 1
fi fi
elif [ "${METHOD}" = 'git' ]; then elif [ "${METHOD}" = 'git' ]; then
if ! nvm_has git; then if ! nvm_has git; then
echo >&2 "You need git to install nvm" nvm_echo >&2 "You need git to install nvm"
exit 1 exit 1
fi fi
install_nvm_from_git install_nvm_from_git
elif [ "${METHOD}" = 'script' ]; then elif [ "${METHOD}" = 'script' ]; then
if ! nvm_has nvm_download; then if ! nvm_has curl && ! nvm_has wget; then
echo >&2 "You need curl or wget to install nvm" nvm_echo >&2 "You need curl or wget to install nvm"
exit 1 exit 1
fi fi
install_nvm_as_script install_nvm_as_script
else
nvm_echo >&2 "The environment variable \$METHOD is set to \"${METHOD}\", which is not recognized as a valid installation method."
exit 1
fi fi
echo nvm_echo
local NVM_PROFILE local NVM_PROFILE
NVM_PROFILE="$(nvm_detect_profile)" NVM_PROFILE="$(nvm_detect_profile)"
@@ -338,32 +417,32 @@ nvm_do_install() {
if [ -n "${PROFILE}" ]; then if [ -n "${PROFILE}" ]; then
TRIED_PROFILE="${NVM_PROFILE} (as defined in \$PROFILE), " TRIED_PROFILE="${NVM_PROFILE} (as defined in \$PROFILE), "
fi fi
echo "=> Profile not found. Tried ${TRIED_PROFILE-}~/.bashrc, ~/.bash_profile, ~/.zshrc, and ~/.profile." nvm_echo "=> Profile not found. Tried ${TRIED_PROFILE-}~/.bashrc, ~/.bash_profile, ~/.zprofile, ~/.zshrc, and ~/.profile."
echo "=> Create one of them and run this script again" nvm_echo "=> Create one of them and run this script again"
echo " OR" nvm_echo " OR"
echo "=> Append the following lines to the correct file yourself:" nvm_echo "=> Append the following lines to the correct file yourself:"
command printf "${SOURCE_STR}" command printf "${SOURCE_STR}"
echo nvm_echo
else else
if nvm_profile_is_bash_or_zsh "${NVM_PROFILE-}"; then if nvm_profile_is_bash_or_zsh "${NVM_PROFILE-}"; then
BASH_OR_ZSH=true BASH_OR_ZSH=true
fi fi
if ! command grep -qc '/nvm.sh' "$NVM_PROFILE"; then if ! command grep -qc '/nvm.sh' "$NVM_PROFILE"; then
echo "=> Appending nvm source string to $NVM_PROFILE" nvm_echo "=> Appending nvm source string to $NVM_PROFILE"
command printf "${SOURCE_STR}" >> "$NVM_PROFILE" command printf "${SOURCE_STR}" >> "$NVM_PROFILE"
else else
echo "=> nvm source string already in ${NVM_PROFILE}" nvm_echo "=> nvm source string already in ${NVM_PROFILE}"
fi fi
# shellcheck disable=SC2016 # shellcheck disable=SC2016
if ${BASH_OR_ZSH} && ! command grep -qc '$NVM_DIR/bash_completion' "$NVM_PROFILE"; then if ${BASH_OR_ZSH} && ! command grep -qc '$NVM_DIR/bash_completion' "$NVM_PROFILE"; then
echo "=> Appending bash_completion source string to $NVM_PROFILE" nvm_echo "=> Appending bash_completion source string to $NVM_PROFILE"
command printf "$COMPLETION_STR" >> "$NVM_PROFILE" command printf "$COMPLETION_STR" >> "$NVM_PROFILE"
else else
echo "=> bash_completion source string already in ${NVM_PROFILE}" nvm_echo "=> bash_completion source string already in ${NVM_PROFILE}"
fi fi
fi fi
if ${BASH_OR_ZSH} && [ -z "${NVM_PROFILE-}" ] ; then if ${BASH_OR_ZSH} && [ -z "${NVM_PROFILE-}" ] ; then
echo "=> Please also append the following lines to the if you are using bash/zsh shell:" nvm_echo "=> Please also append the following lines to the if you are using bash/zsh shell:"
command printf "${COMPLETION_STR}" command printf "${COMPLETION_STR}"
fi fi
@@ -377,7 +456,7 @@ nvm_do_install() {
nvm_reset nvm_reset
echo "=> Close and reopen your terminal to start using nvm or run the following to use it now:" nvm_echo "=> Close and reopen your terminal to start using nvm or run the following to use it now:"
command printf "${SOURCE_STR}" command printf "${SOURCE_STR}"
if ${BASH_OR_ZSH} ; then if ${BASH_OR_ZSH} ; then
command printf "${COMPLETION_STR}" command printf "${COMPLETION_STR}"
@@ -392,7 +471,7 @@ nvm_reset() {
unset -f nvm_has nvm_install_dir nvm_latest_version nvm_profile_is_bash_or_zsh \ unset -f nvm_has nvm_install_dir nvm_latest_version nvm_profile_is_bash_or_zsh \
nvm_source nvm_node_version nvm_download install_nvm_from_git nvm_install_node \ nvm_source nvm_node_version nvm_download install_nvm_from_git nvm_install_node \
install_nvm_as_script nvm_try_profile nvm_detect_profile nvm_check_global_modules \ install_nvm_as_script nvm_try_profile nvm_detect_profile nvm_check_global_modules \
nvm_do_install nvm_reset nvm_do_install nvm_reset nvm_default_install_dir nvm_grep
} }
[ "_$NVM_ENV" = "_testing" ] || nvm_do_install [ "_$NVM_ENV" = "_testing" ] || nvm_do_install

View File

@@ -2,7 +2,7 @@
DIR="$(command cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" DIR="$(command cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# shellcheck disable=SC1090 # shellcheck disable=SC1090,SC1091
\. "$DIR/nvm.sh" --no-use \. "$DIR/nvm.sh" --no-use
if [ -n "$NODE_VERSION" ]; then if [ -n "$NODE_VERSION" ]; then

2442
nvm.sh

File diff suppressed because it is too large Load Diff

View File

@@ -1,13 +1,13 @@
{ {
"name": "nvm", "name": "nvm",
"version": "0.33.11", "version": "0.39.2",
"description": "Node Version Manager - Simple bash script to manage multiple active node.js versions", "description": "Node Version Manager - Simple bash script to manage multiple active node.js versions",
"directories": { "directories": {
"test": "test" "test": "test"
}, },
"scripts": { "scripts": {
"test": "shell=$(basename -- $(ps -o comm= $(ps -o ppid= -p $PPID)) | sed 's/^-//'); make test-$shell", "test": "shell=$(basename -- $(ps -o comm= $(ps -o ppid= -p $PPID)) | sed 's/^-//'); make test-$shell",
"test/fast": "shell=$(basename -- $(ps -o comm= $(ps -o ppid= -p $PPID)) | sed 's/^-//'); make TEST_SUITE=fast test-$shell", "test/fast": "shell=$(basename -- $(ps -o comm= $(ps -o ppid= -p $PPID)) | sed 's/^-//'); env -i TERM=\"$TERM\" bash -lc \"make TEST_SUITE=fast test-$shell\"",
"test/slow": "shell=$(basename -- $(ps -o comm= $(ps -o ppid= -p $PPID)) | sed 's/^-//'); make TEST_SUITE=slow test-$shell", "test/slow": "shell=$(basename -- $(ps -o comm= $(ps -o ppid= -p $PPID)) | sed 's/^-//'); make TEST_SUITE=slow test-$shell",
"test/install_script": "shell=$(basename -- $(ps -o comm= $(ps -o ppid= -p $PPID)) | sed 's/^-//'); make TEST_SUITE=install_script test-$shell", "test/install_script": "shell=$(basename -- $(ps -o comm= $(ps -o ppid= -p $PPID)) | sed 's/^-//'); make TEST_SUITE=install_script test-$shell",
"test/installation": "npm run --silent test/installation/node && npm run --silent test/installation/iojs", "test/installation": "npm run --silent test/installation/node && npm run --silent test/installation/iojs",
@@ -15,11 +15,16 @@
"test/installation/iojs": "shell=$(basename -- $(ps -o comm= $(ps -o ppid= -p $PPID)) | sed 's/^-//'); make TEST_SUITE=installation_iojs test-$shell", "test/installation/iojs": "shell=$(basename -- $(ps -o comm= $(ps -o ppid= -p $PPID)) | sed 's/^-//'); make TEST_SUITE=installation_iojs test-$shell",
"test/sourcing": "shell=$(basename -- $(ps -o comm= $(ps -o ppid= -p $PPID)) | sed 's/^-//'); make TEST_SUITE=sourcing test-$shell", "test/sourcing": "shell=$(basename -- $(ps -o comm= $(ps -o ppid= -p $PPID)) | sed 's/^-//'); make TEST_SUITE=sourcing test-$shell",
"doctoc": "doctoc --title='## Table of Contents' --github README.md", "doctoc": "doctoc --title='## Table of Contents' --github README.md",
"eclint": "eclint check $(git ls-tree --name-only HEAD | xargs)" "predoctoc:check": "cp README.md v-README.md.orig && npm run doctoc",
"doctoc:check": "diff -q README.md v-README.md.orig",
"postdoctoc:check": "mv v-README.md.orig README.md",
"eclint": "eclint check $(git ls-tree --name-only HEAD | xargs)",
"dockerfile_lint": "dockerfile_lint",
"markdown-link-check": "git ls-files | command grep -E '\\.md$' | xargs -n 1 markdown-link-check -p"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
"url": "git://github.com/creationix/nvm.git" "url": "git://github.com/nvm-sh/nvm.git"
}, },
"keywords": [ "keywords": [
"nvm", "nvm",
@@ -31,14 +36,16 @@
"author": "Tim Caswell <tim@creationix.com>", "author": "Tim Caswell <tim@creationix.com>",
"license": "MIT", "license": "MIT",
"bugs": { "bugs": {
"url": "https://github.com/creationix/nvm/issues" "url": "https://github.com/nvm-sh/nvm/issues"
}, },
"homepage": "https://github.com/creationix/nvm", "homepage": "https://github.com/nvm-sh/nvm",
"devDependencies": { "devDependencies": {
"eclint": "^2.6.0", "dockerfile_lint": "^0.3.4",
"replace": "^0.3.0", "doctoc": "^2.1.0",
"semver": "^5.0.1", "eclint": "^2.8.1",
"urchin": "^0.0.5", "markdown-link-check": "^3.9.0",
"doctoc": "^1.2.0" "replace": "^1.2.1",
"semver": "^7.3.5",
"urchin": "^0.0.5"
} }
} }

52
rename_test.sh Executable file
View File

@@ -0,0 +1,52 @@
#! /usr/bin/env bash
find_name(){
find test -name "*[\\/:\*\?\"<>\|]*" -o -name "*."
}
check_name() {
if [ "$(find_name | wc -l)" != "0" ]; then
printf '%s\n\n' "The following filenames contain unwanted characters:"
find_name
printf '\n%s\n%s\n' "Please run ./rename_test.sh" "If the problem persist, please open an issue."
exit 1
else
echo "Ok"
fi
}
rename_test() {
local filename
local new_filename
while read -r filename; do
# Even though it looks < and > are replaced by the same < and >, the latters are not ASCII code
# If you check with 'cat -v rename_test.sh' you would see 's/</M-KM-^B/g' and 's/>/M-KM-^C/g'
# M-KM-^B -> U+02C2
# M-KM-^C -> U+02C3
new_filename=$(echo "$filename" | sed -r \
-e "s/\"/'/g" \
-e 's/</˂/g' \
-e 's/>/˃/g' \
-e 's/^(.*)\.$/\1/'
)
printf '%s\n%s\n\n' "$filename" "$new_filename"
[ "$filename" != "$new_filename" ] && git mv "$filename" "$new_filename"
done < <(find_name)
if [ "$(find_name | wc -l)" != "0" ]; then
echo "Still some files to treat:"
find_name
else
echo "Done"
fi
}
main() {
if [ "$1" = "--check" ]; then
check_name
else
rename_test
fi
}
main "$@"

View File

@@ -29,8 +29,16 @@ make_fake_node() {
VERSION="${1-}" VERSION="${1-}"
[ -n "${VERSION}" ] || return 1 [ -n "${VERSION}" ] || return 1
local FORMATTED_VERSION
FORMATTED_VERSION="$(nvm_format_version "${VERSION}")"
local BIN_PATH local BIN_PATH
BIN_PATH="$(nvm_version_path "${VERSION}")/bin" BIN_PATH="$(nvm_version_path "${FORMATTED_VERSION}")/bin"
[ "${BIN_PATH}" != "/bin" ] || {
echo >&2 'nvm_version_path was empty'
return 5
}
mkdir -p "${BIN_PATH}" || { mkdir -p "${BIN_PATH}" || {
echo >&2 'unable to make bin dir' echo >&2 'unable to make bin dir'
return 2 return 2
@@ -40,6 +48,11 @@ make_fake_node() {
echo >&2 'unable to make fake node bin' echo >&2 'unable to make fake node bin'
return 3 return 3
} }
nvm_is_version_installed "${FORMATTED_VERSION}" || {
echo >&2 'fake node is not installed'
return 4
}
} }
make_fake_iojs() { make_fake_iojs() {
@@ -47,8 +60,16 @@ make_fake_iojs() {
VERSION="${1-}" VERSION="${1-}"
[ -n "${VERSION}" ] || return 1 [ -n "${VERSION}" ] || return 1
local FORMATTED_VERSION
FORMATTED_VERSION="$(nvm_format_version "iojs-${VERSION}")"
local BIN_PATH local BIN_PATH
BIN_PATH="$(nvm_version_path "iojs-${VERSION}")/bin" BIN_PATH="$(nvm_version_path "${FORMATTED_VERSION}")/bin"
[ "${BIN_PATH}" != "/bin" ] || {
echo >&2 'nvm_version_path was empty'
return 5
}
mkdir -p "${BIN_PATH}" || { mkdir -p "${BIN_PATH}" || {
echo >&2 'unable to make bin dir' echo >&2 'unable to make bin dir'
return 2 return 2
@@ -62,6 +83,11 @@ make_fake_iojs() {
echo >&2 'unable to make fake iojs bin' echo >&2 'unable to make fake iojs bin'
return 3 return 3
} }
nvm_is_version_installed "${FORMATTED_VERSION}" || {
echo >&2 'fake iojs is not installed'
return 4
}
} }
watch() { watch() {

View File

@@ -0,0 +1,17 @@
#!/bin/sh
\. ../../../nvm.sh
die () { echo "$@" ; exit 1; }
OUTPUT="$(nvm unalias node 2>&1)"
EXPECTED_OUTPUT="node is a default (built-in) alias and cannot be deleted."
[ "$OUTPUT" = "$EXPECTED_OUTPUT" ] || die "trying to remove a built-in alias should fail with '$EXPECTED_OUTPUT', got '$OUTPUT'"
nvm alias node stable || die '`nvm alias node stable` failed'
nvm unalias node || die '`nvm unalias node` failed'
OUTPUT="$(nvm unalias node 2>&1)"
EXPECTED_OUTPUT="node is a default (built-in) alias and cannot be deleted."
[ "$OUTPUT" = "$EXPECTED_OUTPUT" ] || die "trying to remove a built-in alias should fail with '$EXPECTED_OUTPUT', got '$OUTPUT'"

View File

@@ -0,0 +1,25 @@
#!/bin/sh
\. ../../../nvm.sh
die () { echo "$@" ; exit 1; }
OUTPUT="$(nvm unalias node 2>&1)"
EXPECTED_OUTPUT="node is a default (built-in) alias and cannot be deleted."
[ "$OUTPUT" = "$EXPECTED_OUTPUT" ] || die "trying to remove a built-in alias should fail with '$EXPECTED_OUTPUT', got '$OUTPUT'"
OUTPUT="$(nvm unalias stable 2>&1)"
EXPECTED_OUTPUT="stable is a default (built-in) alias and cannot be deleted."
[ "$OUTPUT" = "$EXPECTED_OUTPUT" ] || die "trying to remove a built-in alias should fail with '$EXPECTED_OUTPUT', got '$OUTPUT'"
OUTPUT="$(nvm unalias unstable 2>&1)"
EXPECTED_OUTPUT="unstable is a default (built-in) alias and cannot be deleted."
[ "$OUTPUT" = "$EXPECTED_OUTPUT" ] || die "trying to remove a built-in alias should fail with '$EXPECTED_OUTPUT', got '$OUTPUT'"
OUTPUT="$(nvm unalias iojs 2>&1)"
EXPECTED_OUTPUT="iojs is a default (built-in) alias and cannot be deleted."
[ "$OUTPUT" = "$EXPECTED_OUTPUT" ] || die "trying to remove a built-in alias should fail with '$EXPECTED_OUTPUT', got '$OUTPUT'"
OUTPUT="$(nvm unalias system 2>&1)"
EXPECTED_OUTPUT="system is a default (built-in) alias and cannot be deleted."
[ "$OUTPUT" = "$EXPECTED_OUTPUT" ] || die "trying to remove a built-in alias should fail with '$EXPECTED_OUTPUT', got '$OUTPUT'"

View File

@@ -14,9 +14,9 @@ cleanup () {
rm -rf "${NVM_DIR}/versions/io.js/v0.2.1" rm -rf "${NVM_DIR}/versions/io.js/v0.2.1"
} }
mkdir "${NVM_DIR}/v0.8.1" make_fake_node v0.8.1
mkdir "${NVM_DIR}/v0.9.1" make_fake_node v0.9.1
mkdir -p "${NVM_DIR}/versions/io.js/v0.2.1" make_fake_iojs v0.2.1
EXPECTED_STABLE="$(nvm_print_implicit_alias local stable)" EXPECTED_STABLE="$(nvm_print_implicit_alias local stable)"
STABLE_VERSION="$(nvm_version "$EXPECTED_STABLE")" STABLE_VERSION="$(nvm_version "$EXPECTED_STABLE")"

View File

@@ -0,0 +1,22 @@
#!/bin/sh
\. ../../../nvm.sh
die () { echo "$@" ; exit 1; }
set -e
nvm_get_colors(){
echo "0;95m"
}
nvm_alias_path() {
nvm_echo "../../../alias"
}
OUTPUT=$(command printf %b $(nvm_list_aliases test-stable-1) | awk '{ print substr($0, 1, 19); }')
EXPECTED_OUTPUT=$(command printf %b "\033[0;95mtest-stable-1" | awk '{ print substr($0, 1, 19); }')
echo "\033[0m"
[ "${OUTPUT}" = "${EXPECTED_OUTPUT}" ] || die "nvm_list_aliases did not call nvm_get_colors. Expected >${EXPECTED_OUTPUT}<; got >${OUTPUT}<"

View File

@@ -0,0 +1,25 @@
#!/bin/sh
\. ../../../nvm.sh
die () {
echo "$@"
exit 1
}
set -e
nvm_alias_path() {
nvm_echo "../../../alias"
}
nvm ls-remote >/dev/null || die 'nvm ls-remote (to populate LTS aliases) failed'
MOCKS_DIR="../Unit tests/mocks"
EXPECTED_OUTPUT="$(cat "$MOCKS_DIR/lts-star.txt")"
STDOUT_OUTPUT="$(nvm_list_aliases "lts/*")"
STDERR_OUTPUT="$(nvm_list_aliases "lts/*" 2>&1 >/dev/null)"
[ -z "${STDERR_OUTPUT}" ] || die "expected no stderr output, got >${STDERR_OUTPUT}<"
[ "${STDOUT_OUTPUT}" = "${EXPECTED_OUTPUT}" ] || die "expected ${EXPECTED_OUTPUT}, got >${STDOUT_OUTPUT}<"

View File

@@ -0,0 +1,21 @@
#!/bin/sh
\. ../../../nvm.sh
die () {
mv "$(nvm_alias_path)/_lts.bak" "$(nvm_alias_path)/lts"
echo "$@"
exit 1
}
set -e
nvm_alias_path() {
nvm_echo "../../../alias"
}
mv "$(nvm_alias_path)/lts" "$(nvm_alias_path)/_lts.bak"
STDERR_OUTPUT="$(nvm_list_aliases 2>&1 >/dev/null)"
[ -z "${STDERR_OUTPUT}" ] || die "expected no stderr output, got >${STDERR_OUTPUT}<"

View File

@@ -0,0 +1,28 @@
#!/bin/sh
\. ../../../nvm.sh
die () {
# echo "$@" ;
echo "Expected >${EXPECTED_OUTPUT}<; got >${OUTPUT}<"
exit 1
}
set -e
nvm_get_colors(){
echo "0;95m"
}
# nvm_print_alias_path call nvm_print_formatted_alias which calls nvm_get-colors
# the output of nvm_print_alias_path uses the color code returned by nvm_get_colors (redefined above)
NVM_ALIAS_DIR='../../../alias'
OUTPUT=$(command printf %b $(nvm_print_alias_path "$NVM_ALIAS_DIR" "$NVM_ALIAS_DIR"/test-stable-1) | awk '{ print substr($0, 1, 24); }')
EXPECTED_OUTPUT=$(command printf %b "\033[0;95mtest-stable-1\033[0m")
[ "${OUTPUT}" = "${EXPECTED_OUTPUT}" ] || die
set +e

View File

@@ -0,0 +1,21 @@
#!/bin/sh
\. ../../../nvm.sh
die () {
echo "Expected >${EXPECTED_OUTPUT}<; got >${OUTPUT}<"
exit 1
}
set -e
# # # expecting in red and two grays:
OUTPUT=$(echo $(nvm_print_formatted_alias fakealias fakedest) | awk '{ print substr($0, 1, 21); }')
EXPECTED_OUTPUT="$(command printf %b "\033[0;31mfakealias\033[0m ")"
[ "${OUTPUT}" = "${EXPECTED_OUTPUT}" ] || die
# expecting in bold yellow and two grays:
nvm set-colors bbbYb
OUTPUT=$(echo $(nvm_print_formatted_alias fakealias fakedest) | awk '{ print substr($0, 1, 21); }')
EXPECTED_OUTPUT="$(command printf %b "\033[1;33mfakealias\033[0m ")"
[ "${OUTPUT}" = "${EXPECTED_OUTPUT}" ] || die

View File

@@ -1,11 +1,14 @@
#!/bin/sh #!/bin/sh
\. ../../../nvm.sh
\. ../../common.sh
for i in $(seq 1 10) for i in $(seq 1 10)
do do
echo 0.0.$i > ../../../alias/test-stable-$i echo 0.0.$i > ../../../alias/test-stable-$i
mkdir -p ../../../v0.0.$i make_fake_node v0.0.$i
echo 0.1.$i > ../../../alias/test-unstable-$i echo 0.1.$i > ../../../alias/test-unstable-$i
mkdir -p ../../../v0.1.$i make_fake_node v0.1.$i
echo 0.2.$i > ../../../alias/test-iojs-$i echo 0.2.$i > ../../../alias/test-iojs-$i
mkdir -p ../../../versions/io.js/v0.2.$i make_fake_iojs v0.2.$i
done done

View File

@@ -1,10 +1,11 @@
#!/bin/sh #!/bin/sh
\. ../../../nvm.sh \. ../../../nvm.sh
\. ../../common.sh
mkdir -p "${NVM_DIR}/v0.0.2" make_fake_node v0.0.2
mkdir -p "${NVM_DIR}/v0.0.20" make_fake_node v0.0.20
mkdir -p "${NVM_DIR}/versions/node/v0.12.0" make_fake_node v0.12.0
die () { echo "$@" ; exit 1; } die () { echo "$@" ; exit 1; }

View File

@@ -1,3 +1,3 @@
rmdir ../../../v0.0.2 >/dev/null 2>&1 rm -rf ../../../v0.0.2
rmdir ../../../v0.0.20 >/dev/null 2>&1 rm -rf ../../../v0.0.20
rmdir ../../../v0.12.0 >/dev/null 2>&1 rm -rf ../../../v0.12.0

View File

@@ -1,24 +0,0 @@
#!/bin/sh
\. ../../../nvm.sh
mkdir "${NVM_DIR}/v0.0.1"
mkdir "${NVM_DIR}/v0.0.3"
mkdir "${NVM_DIR}/v0.0.9"
mkdir "${NVM_DIR}/v0.3.1"
mkdir "${NVM_DIR}/v0.3.3"
mkdir "${NVM_DIR}/v0.3.9"
mkdir -p "${NVM_DIR}/versions/node/v0.12.87"
mkdir -p "${NVM_DIR}/versions/node/v0.12.9"
mkdir -p "${NVM_DIR}/versions/io.js/v0.1.2"
mkdir -p "${NVM_DIR}/versions/io.js/v0.10.2"
# The result should contain the version numbers.
nvm ls | grep v0.0.1 >/dev/null &&
nvm ls | grep v0.0.3 >/dev/null &&
nvm ls | grep v0.0.9 >/dev/null &&
nvm ls | grep v0.3.1 >/dev/null &&
nvm ls | grep v0.3.3 >/dev/null &&
nvm ls | grep v0.3.9 >/dev/null &&
nvm ls | grep v0.12.87 >/dev/null &&
nvm ls | grep iojs-v0.1.2 >/dev/null

View File

@@ -0,0 +1,34 @@
#!/bin/sh
\. ../../../nvm.sh
\. ../../common.sh
die () { echo "$@" ; unset -f nvm_ls nvm_list_aliases; exit 1; }
make_fake_node v0.12.87 || die 'fake v0.12.87 could not be made'
make_fake_node v0.12.9 || die 'fake v0.12.9 could not be made'
make_fake_iojs v0.1.2 || die 'fake iojs-v0.1.2 could not be made'
make_fake_iojs v0.10.2 || die 'fake iojs-v0.10.2 could not be made'
set -e
nvm_list_aliases() {
echo 'sd-6'
}
# sanity check
OUTPUT="$(nvm alias)"
EXPECTED_OUTPUT='sd-6'
[ "${OUTPUT}" = "${EXPECTED_OUTPUT}" ] || die "1: expected >${EXPECTED_OUTPUT}<; got >${OUTPUT}<"
nvm_ls() {
echo v0.12.87
echo v0.12.9
echo iojs-v0.1.2
echo iojs-v0.10.2
}
OUTPUT="$(nvm ls --no-colors --no-alias)"
EXPECTED_OUTPUT=" v0.12.87 *
v0.12.9 *
iojs-v0.1.2 *
iojs-v0.10.2 *"
[ "${OUTPUT}" = "${EXPECTED_OUTPUT}" ] || die "2: expected >${EXPECTED_OUTPUT}<; got >${OUTPUT}<"

View File

@@ -0,0 +1,15 @@
#!/bin/sh
\. ../../../nvm.sh
\. ../../common.sh
die () { echo "$@" ; unset -f nvm_ls nvm_list_aliases; exit 1; }
set -e
OUTPUT="$(nvm ls --no-colors --no-alias pattern 2>&1 ||:)"
EXPECTED_OUTPUT='`--no-alias` is not supported when a pattern is provided.'
EXIT_CODE="$(nvm ls --no-colors --no-alias pattern >/dev/null 2>&1 || echo $?)"
[ "${OUTPUT}" = "${EXPECTED_OUTPUT}" ] || die "expected >${EXPECTED_OUTPUT}<; got >${OUTPUT}<"
[ "${EXIT_CODE}" = 55 ] || die "expected 55; got >${EXIT_CODE}<"

View File

@@ -1,9 +1,10 @@
#!/bin/sh #!/bin/sh
\. ../../../nvm.sh \. ../../../nvm.sh
\. ../../common.sh
mkdir "${NVM_DIR}/v0.0.2" make_fake_node v0.0.2
mkdir "${NVM_DIR}/v0.0.20" make_fake_node v0.0.20
die () { echo "$@" ; exit 1; } die () { echo "$@" ; exit 1; }

View File

@@ -1,10 +1,11 @@
#!/bin/sh #!/bin/sh
\. ../../../nvm.sh \. ../../../nvm.sh
\. ../../common.sh
mkdir "${NVM_DIR}/v0.1.3" make_fake_node v0.1.3
mkdir "${NVM_DIR}/v0.2.3" make_fake_node v0.2.3
mkdir "${NVM_DIR}/v0.20.3" make_fake_node v0.20.3
die () { echo "$@" ; exit 1; } die () { echo "$@" ; exit 1; }

View File

@@ -1,11 +1,12 @@
#!/bin/sh #!/bin/sh
\. ../../../nvm.sh \. ../../../nvm.sh
\. ../../common.sh
die () { echo "$@" ; exit 1; } die () { echo "$@" ; exit 1; }
mkdir "${NVM_DIR}/v0.2.3" make_fake_node v0.2.3
mkdir "${NVM_DIR}/v0.3.3" make_fake_node v0.3.3
EXPECTED_STABLE="$(nvm_print_implicit_alias local stable)" EXPECTED_STABLE="$(nvm_print_implicit_alias local stable)"
STABLE_VERSION="$(nvm_version "$EXPECTED_STABLE")" STABLE_VERSION="$(nvm_version "$EXPECTED_STABLE")"
@@ -19,10 +20,10 @@ nvm ls stable | \grep "$STABLE_VERSION" >/dev/null \
nvm ls unstable | \grep "$UNSTABLE_VERSION" >/dev/null \ nvm ls unstable | \grep "$UNSTABLE_VERSION" >/dev/null \
|| die "expected 'nvm ls unstable' to give $UNSTABLE_VERSION, got $(nvm ls unstable)" || die "expected 'nvm ls unstable' to give $UNSTABLE_VERSION, got $(nvm ls unstable)"
mkdir "${NVM_DIR}/v0.1.2" make_fake_node v0.1.4
nvm alias stable 0.1 nvm alias stable 0.1
nvm ls stable | \grep -v "$STABLE_VERSION" >/dev/null \ nvm ls stable | \grep -v "$STABLE_VERSION" >/dev/null \
|| die "'nvm ls stable' contained $STABLE_VERSION instead of v0.1.2" || die "'nvm ls stable' contained $STABLE_VERSION instead of v0.1.4"
nvm ls stable | \grep v0.1.2 >/dev/null \ nvm ls stable | \grep v0.1.4 >/dev/null \
|| die "'nvm ls stable' did not contain v0.1.2" || die "'nvm ls stable' did not contain v0.1.4"

View File

@@ -3,13 +3,14 @@
die () { echo "$@" ; exit 1; } die () { echo "$@" ; exit 1; }
\. ../../../nvm.sh \. ../../../nvm.sh
\. ../../common.sh
mkdir -p "${NVM_DIR}/v0.0.1" make_fake_node v0.0.1
mkdir -p "${NVM_DIR}/v0.0.3" make_fake_node v0.0.3
mkdir -p "${NVM_DIR}/v0.0.9" make_fake_node v0.0.9
mkdir -p "${NVM_DIR}/v0.3.1" make_fake_node v0.3.1
mkdir -p "${NVM_DIR}/v0.3.3" make_fake_node v0.3.3
mkdir -p "${NVM_DIR}/v0.3.9" make_fake_node v0.3.9
nvm_has_system_node() { return 0; } nvm_has_system_node() { return 0; }
nvm ls system | grep system 2>&1 > /dev/null nvm ls system | grep system 2>&1 > /dev/null

View File

@@ -0,0 +1,35 @@
#!/bin/sh
\. ../../../nvm.sh
\. ../../common.sh
die () { echo "$@" ; unset -f nvm_ls nvm_list_aliases; exit 1; }
make_fake_node v0.12.87 || die 'fake v0.12.87 could not be made'
make_fake_node v0.12.9 || die 'fake v0.12.9 could not be made'
make_fake_iojs v0.1.2 || die 'fake iojs-v0.1.2 could not be made'
make_fake_iojs v0.10.2 || die 'fake iojs-v0.10.2 could not be made'
set -e
nvm_list_aliases() {
echo 'sd-6'
}
# sanity check
OUTPUT="$(nvm alias)"
EXPECTED_OUTPUT='sd-6'
[ "${OUTPUT}" = "${EXPECTED_OUTPUT}" ] || die "1: expected >${EXPECTED_OUTPUT}<; got >${OUTPUT}<"
nvm_ls() {
echo v0.12.87
echo v0.12.9
echo iojs-v0.1.2
echo iojs-v0.10.2
}
OUTPUT="$(nvm ls --no-colors)"
EXPECTED_OUTPUT=" v0.12.87 *
v0.12.9 *
iojs-v0.1.2 *
iojs-v0.10.2 *
sd-6"
[ "${OUTPUT}" = "${EXPECTED_OUTPUT}" ] || die "2: expected >${EXPECTED_OUTPUT}<; got >${OUTPUT}<"

View File

@@ -0,0 +1,44 @@
#!/bin/sh
\. ../../../nvm.sh
\. ../../common.sh
die () { echo "$@" ; exit 1; }
make_fake_node v0.0.1
make_fake_node v0.0.3
make_fake_node v0.0.9
make_fake_node v0.3.1
make_fake_node v0.3.3
make_fake_node v0.3.9
make_fake_node v0.12.87
make_fake_node v0.12.9
make_fake_iojs v0.1.2
make_fake_iojs v0.10.2
# The result should contain the version numbers.
nvm ls | grep v0.0.1 >/dev/null || die "v0.0.1 not found in: $(nvm ls)"
nvm ls | grep v0.0.3 >/dev/null || die "v0.0.3 not found in: $(nvm ls)"
nvm ls | grep v0.0.9 >/dev/null || die "v0.0.9 not found in: $(nvm ls)"
nvm ls | grep v0.3.1 >/dev/null || die "v0.3.1 not found in: $(nvm ls)"
nvm ls | grep v0.3.3 >/dev/null || die "v0.3.3 not found in: $(nvm ls)"
nvm ls | grep v0.3.9 >/dev/null || die "v0.3.9 not found in: $(nvm ls)"
nvm ls | grep v0.12.87 >/dev/null || die "v0.12.87 not found in: $(nvm ls)"
nvm ls | grep iojs-v0.1.2 >/dev/null || die "iojs-v0.1.2 not found in: $(nvm ls)"
OUTPUT="$(nvm_ls)"
EXPECTED_OUTPUT="v0.0.1
v0.0.3
v0.0.9
iojs-v0.1.2
v0.3.1
v0.3.3
v0.3.9
iojs-v0.10.2
v0.12.9
v0.12.87"
if nvm_has_system_node || nvm_has_system_iojs; then
EXPECTED_OUTPUT="${EXPECTED_OUTPUT}
system"
fi
[ "${OUTPUT-}" = "${EXPECTED_OUTPUT-}" ] || die "expected >${EXPECTED_OUTPUT}<; got >${OUTPUT}<"

View File

@@ -1,9 +1,10 @@
#!/bin/sh #!/bin/sh
\. ../../../nvm.sh \. ../../../nvm.sh
\. ../../common.sh
mkdir "${NVM_DIR}/v0.1.3" make_fake_node v0.1.3
mkdir "${NVM_DIR}/v0.2.3" make_fake_node v0.2.3
[ -z `nvm ls | grep '^ *\.'` ] [ -z `nvm ls | grep '^ *\.'` ]
# The result should contain only the appropriate version numbers. # The result should contain only the appropriate version numbers.

View File

@@ -1,10 +1,10 @@
#!/bin/sh #!/bin/sh
\. ../../../nvm.sh \. ../../../nvm.sh
\. ../../common.sh
mkdir "${NVM_DIR}/v0.1.3" make_fake_node v0.1.3
mkdir "${NVM_DIR}/v0.2.3" make_fake_node v0.2.3
mkdir -p "${NVM_DIR}/versions/node"
[ -z "$(nvm ls | \grep 'versions')" ] [ -z "$(nvm ls | \grep 'versions')" ]
# The result should contain only the appropriate version numbers. # The result should contain only the appropriate version numbers.

View File

@@ -3,13 +3,14 @@
die () { echo "$@" ; exit 1; } die () { echo "$@" ; exit 1; }
\. ../../../nvm.sh \. ../../../nvm.sh
\. ../../common.sh
mkdir -p "${NVM_DIR}/v0.0.1" make_fake_node v0.0.1
mkdir -p "${NVM_DIR}/v0.0.3" make_fake_node v0.0.3
mkdir -p "${NVM_DIR}/v0.0.9" make_fake_node v0.0.9
mkdir -p "${NVM_DIR}/v0.3.1" make_fake_node v0.3.1
mkdir -p "${NVM_DIR}/v0.3.3" make_fake_node v0.3.3
mkdir -p "${NVM_DIR}/v0.3.9" make_fake_node v0.3.9
nvm_has_system_node() { return 0; } nvm_has_system_node() { return 0; }
nvm ls | grep system 2>&1 > /dev/null nvm ls | grep system 2>&1 > /dev/null

View File

@@ -3,9 +3,10 @@
die () { echo "$@" ; exit 1; } die () { echo "$@" ; exit 1; }
\. ../../../nvm.sh \. ../../../nvm.sh
\. ../../common.sh
mkdir -p "${NVM_DIR}/versions/node/v0.12.1" make_fake_node v0.12.1
mkdir "${NVM_DIR}/v0.1.3" make_fake_node v0.1.3
nvm ls 0.12 | grep v0.12.1 || die '"nvm ls" did not list a version in the versions/ directory' nvm ls 0.12 | grep v0.12.1 || die '"nvm ls" did not list a version in the versions/ directory'
nvm ls 0.1 | grep v0.1.3 || die '"nvm ls" did not list a version not in the versions/ directory' nvm ls 0.1 | grep v0.1.3 || die '"nvm ls" did not list a version not in the versions/ directory'

View File

@@ -0,0 +1,40 @@
#!/bin/zsh
\. ../../../nvm.sh
\. ../../common.sh
if type setopt >/dev/null 2>&1; then setopt local_options markdirs; fi
die () {
if type unsetopt >/dev/null 2>&1; then unsetopt local_options markdirs; fi
echo "$@";
exit 1;
}
make_fake_node v0.0.1
make_fake_node v0.0.3
make_fake_node v0.0.9
make_fake_node v0.3.1
make_fake_node v0.3.3
make_fake_node v0.3.9
make_fake_node v0.12.87
make_fake_node v0.12.9
make_fake_iojs v0.1.2
make_fake_iojs v0.10.2
OUTPUT="$(nvm_ls)"
EXPECTED_OUTPUT="v0.0.1
v0.0.3
v0.0.9
iojs-v0.1.2
v0.3.1
v0.3.3
v0.3.9
iojs-v0.10.2
v0.12.9
v0.12.87"
if nvm_has_system_node || nvm_has_system_iojs; then
EXPECTED_OUTPUT="${EXPECTED_OUTPUT}
system"
fi
[ "${OUTPUT-}" = "${EXPECTED_OUTPUT-}" ] || die "expected >${EXPECTED_OUTPUT}<; got >${OUTPUT}<"

View File

@@ -1,8 +1,9 @@
#!/bin/sh #!/bin/sh
\. ../../../nvm.sh \. ../../../nvm.sh
\. ../../common.sh
mkdir "${NVM_DIR}/v0.1.2" make_fake_node v0.1.2
nvm ls v0.1 | grep v0.1.2 && nvm ls v0.1 | grep v0.1.2 &&
nvm ls v0.1.2 | grep v0.1.2 && nvm ls v0.1.2 | grep v0.1.2 &&

View File

@@ -0,0 +1,23 @@
#!/bin/sh
die () { echo "$@" ; exit 1; }
\. ../../../nvm.sh
\. ../../common.sh
make_fake_node v0.12.34 || die 'fake v0.12.34 could not be made'
# Enable no unset variable
set -u
# Try an alias that does not exist
output=$(nvm ls 99 2>&1 1>/dev/null || true)
test -z "${output}" || die "1: expected empty; got >${output}"
# Try a version that does not exist
output=$(nvm ls 0.12.00 2>&1 1>/dev/null || true)
test -z "${output}" || die "2: expected empty; got >${output}"
# Try a version that does exist
output=$(nvm ls 0.12.34 2>&1 1>/dev/null || true)
test -z "${output}" || die "3: expected empty; got >${output}"

View File

@@ -1,17 +1,18 @@
#!/bin/sh #!/bin/sh
\. ../../../nvm.sh \. ../../../nvm.sh
\. ../../common.sh
mkdir "${NVM_DIR}/v0.0.1" make_fake_node v0.0.1
mkdir "${NVM_DIR}/v0.0.3" make_fake_node v0.0.3
mkdir "${NVM_DIR}/v0.0.9" make_fake_node v0.0.9
mkdir "${NVM_DIR}/v0.3.1" make_fake_node v0.3.1
mkdir "${NVM_DIR}/v0.3.3" make_fake_node v0.3.3
mkdir "${NVM_DIR}/v0.3.9" make_fake_node v0.3.9
mkdir -p "${NVM_DIR}/versions/node/v0.12.87" make_fake_node v0.12.87
mkdir -p "${NVM_DIR}/versions/node/v0.12.9" make_fake_node v0.12.9
mkdir -p "${NVM_DIR}/versions/io.js/v0.1.2" make_fake_iojs v0.1.2
mkdir -p "${NVM_DIR}/versions/io.js/v0.10.2" make_fake_iojs v0.10.2
set -e set -e

View File

@@ -1,16 +1,16 @@
rmdir ../../../v0.0.1 >/dev/null 2>&1 rm -rf ../../../v0.0.1
rmdir ../../../v0.0.2 >/dev/null 2>&1 rm -rf ../../../v0.0.2
rmdir ../../../v0.0.3 >/dev/null 2>&1 rm -rf ../../../v0.0.3
rmdir ../../../v0.0.9 >/dev/null 2>&1 rm -rf ../../../v0.0.9
rmdir ../../../v0.0.20 >/dev/null 2>&1 rm -rf ../../../v0.0.20
rmdir ../../../v0.1.2 >/dev/null 2>&1 rm -rf ../../../v0.1.2
rmdir ../../../v0.1.3 >/dev/null 2>&1 rm -rf ../../../v0.1.3
rmdir ../../../v0.2.3 >/dev/null 2>&1 rm -rf ../../../v0.1.4
rmdir ../../../v0.3.1 >/dev/null 2>&1 rm -rf ../../../v0.2.3
rmdir ../../../v0.3.3 >/dev/null 2>&1 rm -rf ../../../v0.3.1
rmdir ../../../v0.3.9 >/dev/null 2>&1 rm -rf ../../../v0.3.3
rmdir ../../../v0.20.3 >/dev/null 2>&1 rm -rf ../../../v0.3.9
rmdir ../../../versions >/dev/null 2>&1 rm -rf ../../../v0.20.3
unalias nvm_has_system_node >/dev/null 2>&1 rm -rf ../../../versions
rm -f ../../../alias/stable >/dev/null 2>&1 rm -f ../../../alias/stable
rm -f ../../../alias/unstable >/dev/null 2>&1 rm -f ../../../alias/unstable

View File

@@ -1,12 +0,0 @@
#!/bin/sh
set -ex
cd ../..
mkdir v0.0.1
mkdir src/node-v0.0.1
. ./nvm.sh
nvm uninstall v0.0.1
[ ! -d 'v0.0.1' ] && [ ! -d 'src/node-v0.0.1/files' ]

View File

@@ -2,13 +2,14 @@
set -ex set -ex
mkdir -p ../../v0.2.3
die () { echo "$@" ; exit 1; } die () { echo "$@" ; exit 1; }
[ `expr $PATH : ".*v0.2.3/.*/bin.*"` = 0 ] || echo "WARNING: Unexpectedly found v0.2.3 already active" >&2
\. ../../nvm.sh \. ../../nvm.sh
\. ../common.sh
make_fake_node v0.2.3
[ `expr $PATH : ".*v0.2.3/.*/bin.*"` = 0 ] || echo "WARNING: Unexpectedly found v0.2.3 already active" >&2
nvm use --delete-prefix v0.2.3 || die "Failed to activate v0.2.3" nvm use --delete-prefix v0.2.3 || die "Failed to activate v0.2.3"
[ `expr "$PATH" : ".*v0.2.3/.*/bin.*"` != 0 ] || die "PATH not set up properly" [ `expr "$PATH" : ".*v0.2.3/.*/bin.*"` != 0 ] || die "PATH not set up properly"

View File

@@ -8,8 +8,9 @@ cleanup () {
} }
\. ../../nvm.sh \. ../../nvm.sh
\. ../common.sh
mkdir "${NVM_DIR}/v0.10.4" make_fake_node v0.10.4
nvm deactivate >/dev/null 2>&1 nvm deactivate >/dev/null 2>&1

View File

@@ -0,0 +1,12 @@
#!/bin/sh
set -ex
\. ../../nvm.sh
\. ../common.sh
make_fake_node v0.0.1
nvm uninstall v0.0.1
[ ! -d 'v0.0.1' ]

View File

@@ -2,13 +2,11 @@
set -ex set -ex
cd ../.. \. ../../nvm.sh
mkdir v0.0.1 \. ../common.sh
mkdir src/node-v0.0.1
sudo touch v0.0.1/sudo make_fake_node v0.0.1
sudo touch ""$(nvm_version_path v0.0.1)"/sudo"
. ./nvm.sh
RETURN_MESSAGE="$(nvm uninstall v0.0.1 2>&1 || echo)" RETURN_MESSAGE="$(nvm uninstall v0.0.1 2>&1 || echo)"
CHECK_FOR="Cannot uninstall, incorrect permissions on installation folder" CHECK_FOR="Cannot uninstall, incorrect permissions on installation folder"

View File

@@ -9,6 +9,7 @@ cleanup () { rm -f "${BEFORE}" "${AFTER}"; }
die () { echo "$@" ; cleanup ; exit 1; } die () { echo "$@" ; cleanup ; exit 1; }
typeset -f | awk '/ \(\) $/ && !/^main / {print $1}' > "${BEFORE}" typeset -f | awk '/ \(\) $/ && !/^main / {print $1}' > "${BEFORE}"
env | grep -v PATH= | grep -v IFS= | grep -v NVM_ | sort >> "${BEFORE}"
set +e # TODO: fix set +e # TODO: fix
\. ../../nvm.sh \. ../../nvm.sh
@@ -19,6 +20,7 @@ type nvm > /dev/null 2>&1 || die "nvm not loaded"
nvm unload nvm unload
typeset -f | awk '/ \(\) $/ && !/^main / {print $1}' > "${AFTER}" typeset -f | awk '/ \(\) $/ && !/^main / {print $1}' > "${AFTER}"
env | grep -v PATH= | grep -v IFS= | sort >> "${AFTER}"
! type nvm > /dev/null 2>&1 || die "nvm not unloaded" ! type nvm > /dev/null 2>&1 || die "nvm not unloaded"

View File

@@ -27,7 +27,9 @@ EXPECTED_OUTPUT="$(nvm_add_iojs_prefix ${VERSION})"
nvm use --delete-prefix iojs || die '`nvm use iojs` failed' nvm use --delete-prefix iojs || die '`nvm use iojs` failed'
CURRENT="$(nvm current)" # Remove node_modules/.bin from the path so that the system version `which` is
# used in nvm_ls_current
PATH=$(echo "$PATH" | tr ":" "\n" | grep -v "node_modules/.bin" | tr "\n" ":") CURRENT="$(nvm current)"
echo "current: ${CURRENT}" echo "current: ${CURRENT}"
[ "${CURRENT}" = "${IOJS_VERSION}" ] || die "expected >${IOJS_VERSION}<; got >${CURRENT}<" [ "${CURRENT}" = "${IOJS_VERSION}" ] || die "expected >${IOJS_VERSION}<; got >${CURRENT}<"

View File

@@ -4,11 +4,12 @@ set -ex
export NVM_SYMLINK_CURRENT=true export NVM_SYMLINK_CURRENT=true
\. ../../nvm.sh \. ../../nvm.sh
\. ../common.sh
rm -rf "${NVM_DIR}/v0.10.29" rm -rf "${NVM_DIR}/v0.10.29"
mkdir "${NVM_DIR}/v0.10.29" make_fake_node v0.10.29
nvm use --delete-prefix 0.10.29 nvm use --delete-prefix 0.10.29
rmdir "${NVM_DIR}/v0.10.29" rm -rf "${NVM_DIR}/v0.10.29"
if [ ! -L "${NVM_DIR}/current" ];then if [ ! -L "${NVM_DIR}/current" ];then
echo "Expected 'current' symlink to be created!" echo "Expected 'current' symlink to be created!"
@@ -23,9 +24,9 @@ if [ "$(basename "${oldLink}")" != 'v0.10.29' ];then
fi fi
rm -rf "${NVM_DIR}/v0.11.13" rm -rf "${NVM_DIR}/v0.11.13"
mkdir "${NVM_DIR}/v0.11.13" make_fake_node v0.11.13
nvm use --delete-prefix 0.11.13 nvm use --delete-prefix 0.11.13
rmdir "${NVM_DIR}/v0.11.13" rm -rf "${NVM_DIR}/v0.11.13"
newLink="$(readlink "${NVM_DIR}/current")" newLink="$(readlink "${NVM_DIR}/current")"

View File

@@ -3,6 +3,7 @@
set -ex set -ex
\. ../../nvm.sh \. ../../nvm.sh
\. ../common.sh
TEST_NODE_VERSION="v0.10.29" TEST_NODE_VERSION="v0.10.29"
@@ -35,9 +36,9 @@ cleanup() {
} }
runNvmUse() { runNvmUse() {
mkdir "${NVM_DIR}/${TEST_NODE_VERSION}" make_fake_node "$TEST_NODE_VERSION"
nvm use --delete-prefix "${TEST_NODE_VERSION}" > /dev/null 2>&1 nvm use --delete-prefix "${TEST_NODE_VERSION}" > /dev/null 2>&1
rmdir "${NVM_DIR}/${TEST_NODE_VERSION}" rm -rf "${NVM_DIR}/${TEST_NODE_VERSION}"
} }
isCurrentSymlinkPresent() { isCurrentSymlinkPresent() {

View File

@@ -0,0 +1,33 @@
#!/bin/sh
set -ex
die () { echo "$@" ; cleanup ; exit 1; }
cleanup() {
unset VERSION1 VERSION2 VERSION3
rm .nvmrc
}
\. ../../nvm.sh
# normal .nvmrc
printf '0.999.0\n' > .nvmrc
nvm_rc_version
VERSION1="${NVM_RC_VERSION}"
# .nvmrc with CR char
printf '0.999.0\r\n' > .nvmrc
nvm_rc_version
VERSION2="${NVM_RC_VERSION}"
[ "${VERSION1}" = "${VERSION2}" ]
# .nvmrc without any newline char
printf '0.999.0' > .nvmrc
nvm_rc_version
VERSION3="${NVM_RC_VERSION}"
[ "${VERSION1}" = "${VERSION3}" ]
cleanup

View File

@@ -0,0 +1,21 @@
#!/bin/sh
set -ex
die () {
echo "Expected >${EXPECTED_OUTPUT}<; got >${OUTPUT}<"
exit 1
}
cleanup() {
echo "Tested nvm_echo_with_colors"
}
\. ../../../nvm.sh
OUTPUT="$(nvm_echo_with_colors "\033[0;36mCyan-colored text")"
EXPECTED_OUTPUT=$(printf "\033[0;36mCyan-colored text")
[ "_$OUTPUT" = "_$EXPECTED_OUTPUT" ] || die
cleanup

View File

@@ -0,0 +1,19 @@
#!/bin/sh
set -ex
die () { echo "$@" ; cleanup ; exit 1; }
cleanup() {
echo "Tested nvm_err_with_colors"
}
\. ../../../nvm.sh
set +ex
OUTPUT="$(nvm_err_with_colors "\033[0;35mMagenta-colored text" 2>&1)"
set -ex
EXPECTED_OUTPUT=$(printf "\033[0;35mMagenta-colored text")
[ "_$OUTPUT" = "_$EXPECTED_OUTPUT" ] || die
cleanup

View File

@@ -0,0 +1,24 @@
#!/bin/sh
\. ../../../nvm.sh
die () {
# echo "$@" ;
echo "Expected >${EXPECTED_OUTPUT}<; got >${OUTPUT}<"
exit 1
}
set -e
nvm_get_colors(){
echo "0;95m"
}
# nvm_print_default_alias call nvm_print_formatted_alias which calls nvm_get-colors
# the output of nvm_print_default_alias uses the color code returned by nvm_get_colors (redefined above)
OUTPUT=$(command printf %b $(nvm_print_default_alias node ./alias v14.7.0) | awk '{ print substr($0, 1, 11); }')
EXPECTED_OUTPUT=$(command printf %b "\033[0;95mnode")
[ "${OUTPUT}" = "${EXPECTED_OUTPUT}" ] || die
set +e

View File

@@ -0,0 +1,52 @@
#!/bin/sh
\. ../../../nvm.sh
set -e
die () {
# echo "$@" ;
echo "Expected >${EXPECTED_OUTPUT}<; got >${OUTPUT}<"
exit 1
}
cleanup() {
if [ -n TEMP_NVM_COLORS ]; then
export NVM_COLORS=TEMP_NVM_COLORS
fi
unset TEMP_NVM_COLORS
}
if [ -n ${NVM_COLORS} ]; then
export TEMP_NVM_COLORS=NVM_COLORS
unset NVM_COLORS
fi
# default system color
nvm use system
OUTPUT=$(nvm_print_versions system)
FORMAT="\033[0;32m-> %12s\033[0m"
VERSION='system'
EXPECTED_OUTPUT=$(command printf -- "${FORMAT}\\n" "${VERSION}")
[ "${OUTPUT}" = "${EXPECTED_OUTPUT}" ] || die
nvm_ls_current() { echo "current";}
# default current color
OUTPUT=$(nvm_print_versions current)
FORMAT="\033[0;32m-> %12s\033[0m"
VERSION="current"
EXPECTED_OUTPUT=$(command printf -- "${FORMAT}\\n" "${VERSION}")
[ "${OUTPUT}" = "${EXPECTED_OUTPUT}" ] || die
# custom current color
nvm set-colors YCMGR
OUTPUT=$(nvm_print_versions current)
FORMAT="\033[1;35m-> %12s\033[0m"
VERSION="current"
EXPECTED_OUTPUT=$(command printf -- "${FORMAT}\\n" "${VERSION}")
[ "${OUTPUT}" = "${EXPECTED_OUTPUT}" ] || die
cleanup

View File

@@ -1,17 +0,0 @@
#!/bin/sh
die () { echo "$@" ; exit 1; }
\. ../../../nvm.sh
\. ../../common.sh
assert_not_ok iojs_version_has_solaris_binary ""
assert_not_ok iojs_version_has_solaris_binary "foo"
assert_not_ok iojs_version_has_solaris_binary "v1.1.0"
assert_ok iojs_version_has_solaris_binary "v3.3.1"
assert_ok iojs_version_has_solaris_binary "iojs-v3.3.1"
assert_ok iojs_version_has_solaris_binary "v3.3.2"
assert_ok iojs_version_has_solaris_binary "iojs-v3.3.2"
assert_ok iojs_version_has_solaris_binary "v3.4.1"
assert_ok iojs_version_has_solaris_binary "iojs-v3.4.1"

View File

@@ -0,0 +1,7 @@
gallium
fermium
erbium
dubnium
carbon
boron
argon

View File

@@ -0,0 +1 @@
lts/gallium

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -2,7 +2,7 @@
iojs-v1.0.1 iojs-v1.0.1
iojs-v1.0.2 iojs-v1.0.2
iojs-v1.0.3 iojs-v1.0.3
iojs-v1.0.4  iojs-v1.0.4
iojs-v1.1.0 iojs-v1.1.0
iojs-v1.2.0 iojs-v1.2.0
iojs-v1.3.0 iojs-v1.3.0
@@ -20,7 +20,7 @@
iojs-v1.8.1 iojs-v1.8.1
iojs-v1.8.2 iojs-v1.8.2
iojs-v1.8.3 iojs-v1.8.3
iojs-v1.8.4  iojs-v1.8.4
iojs-v2.0.0 iojs-v2.0.0
iojs-v2.0.1 iojs-v2.0.1
iojs-v2.0.2 iojs-v2.0.2
@@ -33,9 +33,9 @@
iojs-v2.3.3 iojs-v2.3.3
iojs-v2.3.4 iojs-v2.3.4
iojs-v2.4.0 iojs-v2.4.0
iojs-v2.5.0  iojs-v2.5.0
iojs-v3.0.0  iojs-v3.0.0
iojs-v3.1.0  iojs-v3.1.0
iojs-v3.2.0  iojs-v3.2.0
iojs-v3.3.0 iojs-v3.3.0
iojs-v3.3.1  iojs-v3.3.1

View File

@@ -33,7 +33,7 @@
v4.8.6  (LTS: Argon) v4.8.6  (LTS: Argon)
v4.8.7  (LTS: Argon) v4.8.7  (LTS: Argon)
v4.9.0  (LTS: Argon) v4.9.0  (LTS: Argon)
v4.9.1  (Latest LTS: Argon)  v4.9.1  (Latest LTS: Argon)
v6.9.0  (LTS: Boron) v6.9.0  (LTS: Boron)
v6.9.1  (LTS: Boron) v6.9.1  (LTS: Boron)
v6.9.2  (LTS: Boron) v6.9.2  (LTS: Boron)
@@ -57,7 +57,15 @@
v6.13.0  (LTS: Boron) v6.13.0  (LTS: Boron)
v6.13.1  (LTS: Boron) v6.13.1  (LTS: Boron)
v6.14.0  (LTS: Boron) v6.14.0  (LTS: Boron)
v6.14.1  (Latest LTS: Boron) v6.14.1  (LTS: Boron)
v6.14.2  (LTS: Boron)
v6.14.3  (LTS: Boron)
v6.14.4  (LTS: Boron)
v6.15.0  (LTS: Boron)
v6.15.1  (LTS: Boron)
v6.16.0  (LTS: Boron)
v6.17.0  (LTS: Boron)
 v6.17.1  (Latest LTS: Boron)
v8.9.0  (LTS: Carbon) v8.9.0  (LTS: Carbon)
v8.9.1  (LTS: Carbon) v8.9.1  (LTS: Carbon)
v8.9.2  (LTS: Carbon) v8.9.2  (LTS: Carbon)
@@ -65,4 +73,115 @@
v8.9.4  (LTS: Carbon) v8.9.4  (LTS: Carbon)
v8.10.0  (LTS: Carbon) v8.10.0  (LTS: Carbon)
v8.11.0  (LTS: Carbon) v8.11.0  (LTS: Carbon)
v8.11.1  (Latest LTS: Carbon) v8.11.1  (LTS: Carbon)
v8.11.2  (LTS: Carbon)
v8.11.3  (LTS: Carbon)
v8.11.4  (LTS: Carbon)
v8.12.0  (LTS: Carbon)
v8.13.0  (LTS: Carbon)
v8.14.0  (LTS: Carbon)
v8.14.1  (LTS: Carbon)
v8.15.0  (LTS: Carbon)
v8.15.1  (LTS: Carbon)
v8.16.0  (LTS: Carbon)
v8.16.1  (LTS: Carbon)
 v8.16.2  (LTS: Carbon)
 v8.17.0  (Latest LTS: Carbon)
v10.13.0  (LTS: Dubnium)
v10.14.0  (LTS: Dubnium)
v10.14.1  (LTS: Dubnium)
v10.14.2  (LTS: Dubnium)
v10.15.0  (LTS: Dubnium)
v10.15.1  (LTS: Dubnium)
v10.15.2  (LTS: Dubnium)
v10.15.3  (LTS: Dubnium)
v10.16.0  (LTS: Dubnium)
v10.16.1  (LTS: Dubnium)
v10.16.2  (LTS: Dubnium)
 v10.16.3  (LTS: Dubnium)
 v10.17.0  (LTS: Dubnium)
v10.18.0  (LTS: Dubnium)
v10.18.1  (LTS: Dubnium)
v10.19.0  (LTS: Dubnium)
v10.20.0  (LTS: Dubnium)
 v10.20.1  (LTS: Dubnium)
 v10.21.0  (LTS: Dubnium)
 v10.22.0  (LTS: Dubnium)
 v10.22.1  (LTS: Dubnium)
 v10.23.0  (LTS: Dubnium)
v10.23.1  (LTS: Dubnium)
v10.23.2  (LTS: Dubnium)
v10.23.3  (LTS: Dubnium)
v10.24.0  (LTS: Dubnium)
 v10.24.1  (Latest LTS: Dubnium)
v12.13.0  (LTS: Erbium)
 v12.13.1  (LTS: Erbium)
v12.14.0  (LTS: Erbium)
 v12.14.1  (LTS: Erbium)
 v12.15.0  (LTS: Erbium)
 v12.16.0  (LTS: Erbium)
 v12.16.1  (LTS: Erbium)
v12.16.2  (LTS: Erbium)
 v12.16.3  (LTS: Erbium)
 v12.17.0  (LTS: Erbium)
v12.18.0  (LTS: Erbium)
v12.18.1  (LTS: Erbium)
v12.18.2  (LTS: Erbium)
v12.18.3  (LTS: Erbium)
 v12.18.4  (LTS: Erbium)
v12.19.0  (LTS: Erbium)
 v12.19.1  (LTS: Erbium)
v12.20.0  (LTS: Erbium)
v12.20.1  (LTS: Erbium)
 v12.20.2  (LTS: Erbium)
 v12.21.0  (LTS: Erbium)
v12.22.0  (LTS: Erbium)
v12.22.1  (LTS: Erbium)
v12.22.2  (LTS: Erbium)
v12.22.3  (LTS: Erbium)
v12.22.4  (LTS: Erbium)
v12.22.5  (LTS: Erbium)
v12.22.6  (LTS: Erbium)
v12.22.7  (LTS: Erbium)
v12.22.8  (LTS: Erbium)
v12.22.9  (LTS: Erbium)
v12.22.10  (LTS: Erbium)
v12.22.11  (LTS: Erbium)
 v12.22.12  (Latest LTS: Erbium)
v14.15.0  (LTS: Fermium)
v14.15.1  (LTS: Fermium)
v14.15.2  (LTS: Fermium)
v14.15.3  (LTS: Fermium)
v14.15.4  (LTS: Fermium)
 v14.15.5  (LTS: Fermium)
v14.16.0  (LTS: Fermium)
 v14.16.1  (LTS: Fermium)
v14.17.0  (LTS: Fermium)
v14.17.1  (LTS: Fermium)
v14.17.2  (LTS: Fermium)
v14.17.3  (LTS: Fermium)
v14.17.4  (LTS: Fermium)
v14.17.5  (LTS: Fermium)
 v14.17.6  (LTS: Fermium)
v14.18.0  (LTS: Fermium)
v14.18.1  (LTS: Fermium)
v14.18.2  (LTS: Fermium)
 v14.18.3  (LTS: Fermium)
v14.19.0  (LTS: Fermium)
v14.19.1  (LTS: Fermium)
v14.19.2  (LTS: Fermium)
 v14.19.3  (LTS: Fermium)
 v14.20.0  (LTS: Fermium)
 v14.20.1  (Latest LTS: Fermium)
v16.13.0  (LTS: Gallium)
v16.13.1  (LTS: Gallium)
 v16.13.2  (LTS: Gallium)
v16.14.0  (LTS: Gallium)
v16.14.1  (LTS: Gallium)
 v16.14.2  (LTS: Gallium)
v16.15.0  (LTS: Gallium)
 v16.15.1  (LTS: Gallium)
 v16.16.0  (LTS: Gallium)
v16.17.0  (LTS: Gallium)
 v16.17.1  (LTS: Gallium)
 v16.18.0  (Latest LTS: Gallium)

View File

@@ -61,7 +61,7 @@
v0.4.9 v0.4.9
v0.4.10 v0.4.10
v0.4.11 v0.4.11
v0.4.12  v0.4.12
v0.5.0 v0.5.0
v0.5.1 v0.5.1
v0.5.2 v0.5.2
@@ -72,7 +72,7 @@
v0.5.7 v0.5.7
v0.5.8 v0.5.8
v0.5.9 v0.5.9
v0.5.10  v0.5.10
v0.6.0 v0.6.0
v0.6.1 v0.6.1
v0.6.2 v0.6.2
@@ -94,20 +94,20 @@
v0.6.18 v0.6.18
v0.6.19 v0.6.19
v0.6.20 v0.6.20
v0.6.21  v0.6.21
v0.7.0 v0.7.0
v0.7.1 v0.7.1
v0.7.2 v0.7.2
v0.7.3 v0.7.3
v0.7.4 v0.7.4
v0.7.5  v0.7.5
v0.7.6  v0.7.6
v0.7.7  v0.7.7
v0.7.8 v0.7.8
v0.7.9 v0.7.9
v0.7.10 v0.7.10
v0.7.11 v0.7.11
v0.7.12  v0.7.12
v0.8.0 v0.8.0
v0.8.1 v0.8.1
v0.8.2 v0.8.2
@@ -135,8 +135,8 @@
v0.8.24 v0.8.24
v0.8.25 v0.8.25
v0.8.26 v0.8.26
v0.8.27  v0.8.27
v0.8.28  v0.8.28
v0.9.0 v0.9.0
v0.9.1 v0.9.1
v0.9.2 v0.9.2
@@ -149,7 +149,7 @@
v0.9.9 v0.9.9
v0.9.10 v0.9.10
v0.9.11 v0.9.11
v0.9.12  v0.9.12
v0.10.0 v0.10.0
v0.10.1 v0.10.1
v0.10.2 v0.10.2
@@ -198,8 +198,8 @@
v0.10.45 v0.10.45
v0.10.46 v0.10.46
v0.10.47 v0.10.47
v0.10.48  v0.10.48
v0.11.0  v0.11.0
v0.11.1 v0.11.1
v0.11.2 v0.11.2
v0.11.3 v0.11.3
@@ -213,10 +213,10 @@
v0.11.11 v0.11.11
v0.11.12 v0.11.12
v0.11.13 v0.11.13
v0.11.14  v0.11.14
v0.11.15  v0.11.15
v0.11.16  v0.11.16
v0.12.0  v0.12.0
v0.12.1 v0.12.1
v0.12.2 v0.12.2
v0.12.3 v0.12.3
@@ -234,8 +234,8 @@
v0.12.15 v0.12.15
v0.12.16 v0.12.16
v0.12.17 v0.12.17
v0.12.18  v0.12.18
v4.0.0  v4.0.0
v4.1.0 v4.1.0
v4.1.1 v4.1.1
v4.1.2 v4.1.2
@@ -274,8 +274,8 @@
v4.8.6  (LTS: Argon) v4.8.6  (LTS: Argon)
v4.8.7  (LTS: Argon) v4.8.7  (LTS: Argon)
v4.9.0  (LTS: Argon) v4.9.0  (LTS: Argon)
v4.9.1  (Latest LTS: Argon)  v4.9.1  (Latest LTS: Argon)
v5.0.0  v5.0.0
v5.1.0 v5.1.0
v5.1.1 v5.1.1
v5.2.0 v5.2.0
@@ -288,17 +288,17 @@
v5.7.1 v5.7.1
v5.8.0 v5.8.0
v5.9.0 v5.9.0
v5.9.1  v5.9.1
v5.10.0 v5.10.0
v5.10.1 v5.10.1
v5.11.0 v5.11.0
v5.11.1 v5.11.1
v5.12.0  v5.12.0
v6.0.0  v6.0.0
v6.1.0  v6.1.0
v6.2.0 v6.2.0
v6.2.1 v6.2.1
v6.2.2  v6.2.2
v6.3.0 v6.3.0
v6.3.1 v6.3.1
v6.4.0 v6.4.0
@@ -330,9 +330,17 @@
v6.13.0  (LTS: Boron) v6.13.0  (LTS: Boron)
v6.13.1  (LTS: Boron) v6.13.1  (LTS: Boron)
v6.14.0  (LTS: Boron) v6.14.0  (LTS: Boron)
v6.14.1  (Latest LTS: Boron) v6.14.1  (LTS: Boron)
v6.14.2  (LTS: Boron)
v6.14.3  (LTS: Boron)
v6.14.4  (LTS: Boron)
v6.15.0  (LTS: Boron)
v6.15.1  (LTS: Boron)
v6.16.0  (LTS: Boron)
v6.17.0  (LTS: Boron)
 v6.17.1  (Latest LTS: Boron)
v7.0.0 v7.0.0
v7.1.0  v7.1.0
v7.2.0 v7.2.0
v7.2.1 v7.2.1
v7.3.0 v7.3.0
@@ -347,8 +355,8 @@
v7.8.0 v7.8.0
v7.9.0 v7.9.0
v7.10.0 v7.10.0
v7.10.1  v7.10.1
v8.0.0  v8.0.0
v8.1.0 v8.1.0
v8.1.1 v8.1.1
v8.1.2 v8.1.2
@@ -356,7 +364,7 @@
v8.1.4 v8.1.4
v8.2.0 v8.2.0
v8.2.1 v8.2.1
v8.3.0  v8.3.0
v8.4.0 v8.4.0
v8.5.0 v8.5.0
v8.6.0 v8.6.0
@@ -370,8 +378,21 @@
v8.9.4  (LTS: Carbon) v8.9.4  (LTS: Carbon)
v8.10.0  (LTS: Carbon) v8.10.0  (LTS: Carbon)
v8.11.0  (LTS: Carbon) v8.11.0  (LTS: Carbon)
v8.11.1  (Latest LTS: Carbon) v8.11.1  (LTS: Carbon)
v9.0.0 v8.11.2  (LTS: Carbon)
v8.11.3  (LTS: Carbon)
v8.11.4  (LTS: Carbon)
v8.12.0  (LTS: Carbon)
v8.13.0  (LTS: Carbon)
v8.14.0  (LTS: Carbon)
v8.14.1  (LTS: Carbon)
v8.15.0  (LTS: Carbon)
v8.15.1  (LTS: Carbon)
v8.16.0  (LTS: Carbon)
v8.16.1  (LTS: Carbon)
 v8.16.2  (LTS: Carbon)
 v8.17.0  (Latest LTS: Carbon)
 v9.0.0
v9.1.0 v9.1.0
v9.2.0 v9.2.0
v9.2.1 v9.2.1
@@ -388,3 +409,249 @@
v9.10.1 v9.10.1
v9.11.0 v9.11.0
v9.11.1 v9.11.1
 v9.11.2
 v10.0.0
 v10.1.0
v10.2.0
 v10.2.1
v10.3.0
v10.4.0
v10.4.1
v10.5.0
v10.6.0
v10.7.0
 v10.8.0
 v10.9.0
 v10.10.0
v10.11.0
v10.12.0
v10.13.0  (LTS: Dubnium)
v10.14.0  (LTS: Dubnium)
v10.14.1  (LTS: Dubnium)
v10.14.2  (LTS: Dubnium)
v10.15.0  (LTS: Dubnium)
v10.15.1  (LTS: Dubnium)
v10.15.2  (LTS: Dubnium)
v10.15.3  (LTS: Dubnium)
v10.16.0  (LTS: Dubnium)
v10.16.1  (LTS: Dubnium)
v10.16.2  (LTS: Dubnium)
 v10.16.3  (LTS: Dubnium)
 v10.17.0  (LTS: Dubnium)
v10.18.0  (LTS: Dubnium)
v10.18.1  (LTS: Dubnium)
v10.19.0  (LTS: Dubnium)
v10.20.0  (LTS: Dubnium)
 v10.20.1  (LTS: Dubnium)
 v10.21.0  (LTS: Dubnium)
 v10.22.0  (LTS: Dubnium)
 v10.22.1  (LTS: Dubnium)
 v10.23.0  (LTS: Dubnium)
v10.23.1  (LTS: Dubnium)
v10.23.2  (LTS: Dubnium)
v10.23.3  (LTS: Dubnium)
v10.24.0  (LTS: Dubnium)
 v10.24.1  (Latest LTS: Dubnium)
v11.0.0
v11.1.0
v11.2.0
v11.3.0
v11.4.0
v11.5.0
v11.6.0
v11.7.0
v11.8.0
v11.9.0
v11.10.0
v11.10.1
v11.11.0
v11.12.0
 v11.13.0
 v11.14.0
 v11.15.0
 v12.0.0
 v12.1.0
 v12.2.0
v12.3.0
 v12.3.1
 v12.4.0
 v12.5.0
 v12.6.0
 v12.7.0
 v12.8.0
 v12.8.1
v12.9.0
 v12.9.1
 v12.10.0
v12.11.0
 v12.11.1
 v12.12.0
v12.13.0  (LTS: Erbium)
 v12.13.1  (LTS: Erbium)
v12.14.0  (LTS: Erbium)
 v12.14.1  (LTS: Erbium)
 v12.15.0  (LTS: Erbium)
 v12.16.0  (LTS: Erbium)
 v12.16.1  (LTS: Erbium)
v12.16.2  (LTS: Erbium)
 v12.16.3  (LTS: Erbium)
 v12.17.0  (LTS: Erbium)
v12.18.0  (LTS: Erbium)
v12.18.1  (LTS: Erbium)
v12.18.2  (LTS: Erbium)
v12.18.3  (LTS: Erbium)
 v12.18.4  (LTS: Erbium)
v12.19.0  (LTS: Erbium)
 v12.19.1  (LTS: Erbium)
v12.20.0  (LTS: Erbium)
v12.20.1  (LTS: Erbium)
 v12.20.2  (LTS: Erbium)
 v12.21.0  (LTS: Erbium)
v12.22.0  (LTS: Erbium)
v12.22.1  (LTS: Erbium)
v12.22.2  (LTS: Erbium)
v12.22.3  (LTS: Erbium)
v12.22.4  (LTS: Erbium)
v12.22.5  (LTS: Erbium)
v12.22.6  (LTS: Erbium)
v12.22.7  (LTS: Erbium)
v12.22.8  (LTS: Erbium)
v12.22.9  (LTS: Erbium)
v12.22.10  (LTS: Erbium)
v12.22.11  (LTS: Erbium)
 v12.22.12  (Latest LTS: Erbium)
 v13.0.0
 v13.0.1
 v13.1.0
 v13.2.0
 v13.3.0
 v13.4.0
 v13.5.0
 v13.6.0
 v13.7.0
 v13.8.0
 v13.9.0
v13.10.0
 v13.10.1
 v13.11.0
 v13.12.0
 v13.13.0
 v13.14.0
 v14.0.0
 v14.1.0
 v14.2.0
 v14.3.0
 v14.4.0
 v14.5.0
 v14.6.0
 v14.7.0
 v14.8.0
 v14.9.0
v14.10.0
 v14.10.1
 v14.11.0
 v14.12.0
 v14.13.0
 v14.13.1
 v14.14.0
v14.15.0  (LTS: Fermium)
v14.15.1  (LTS: Fermium)
v14.15.2  (LTS: Fermium)
v14.15.3  (LTS: Fermium)
v14.15.4  (LTS: Fermium)
 v14.15.5  (LTS: Fermium)
v14.16.0  (LTS: Fermium)
 v14.16.1  (LTS: Fermium)
v14.17.0  (LTS: Fermium)
v14.17.1  (LTS: Fermium)
v14.17.2  (LTS: Fermium)
v14.17.3  (LTS: Fermium)
v14.17.4  (LTS: Fermium)
v14.17.5  (LTS: Fermium)
 v14.17.6  (LTS: Fermium)
v14.18.0  (LTS: Fermium)
v14.18.1  (LTS: Fermium)
v14.18.2  (LTS: Fermium)
 v14.18.3  (LTS: Fermium)
v14.19.0  (LTS: Fermium)
v14.19.1  (LTS: Fermium)
v14.19.2  (LTS: Fermium)
 v14.19.3  (LTS: Fermium)
 v14.20.0  (LTS: Fermium)
 v14.20.1  (Latest LTS: Fermium)
v15.0.0
 v15.0.1
 v15.1.0
v15.2.0
 v15.2.1
 v15.3.0
v15.4.0
v15.5.0
 v15.5.1
v15.6.0
v15.7.0
v15.8.0
v15.9.0
 v15.10.0
v15.11.0
v15.12.0
 v15.13.0
 v15.14.0
 v16.0.0
 v16.1.0
 v16.2.0
 v16.3.0
v16.4.0
v16.4.1
 v16.4.2
 v16.5.0
v16.6.0
v16.6.1
 v16.6.2
 v16.7.0
 v16.8.0
v16.9.0
 v16.9.1
 v16.10.0
v16.11.0
 v16.11.1
 v16.12.0
v16.13.0  (LTS: Gallium)
v16.13.1  (LTS: Gallium)
 v16.13.2  (LTS: Gallium)
v16.14.0  (LTS: Gallium)
v16.14.1  (LTS: Gallium)
 v16.14.2  (LTS: Gallium)
v16.15.0  (LTS: Gallium)
 v16.15.1  (LTS: Gallium)
 v16.16.0  (LTS: Gallium)
v16.17.0  (LTS: Gallium)
 v16.17.1  (LTS: Gallium)
 v16.18.0  (Latest LTS: Gallium)
v17.0.0
 v17.0.1
 v17.1.0
 v17.2.0
v17.3.0
 v17.3.1
 v17.4.0
 v17.5.0
 v17.6.0
 v17.7.0
v17.7.1
 v17.7.2
 v17.8.0
v17.9.0
 v17.9.1
 v18.0.0
 v18.1.0
 v18.2.0
 v18.3.0
 v18.4.0
 v18.5.0
 v18.6.0
 v18.7.0
 v18.8.0
 v18.9.0
 v18.9.1
 v18.10.0

View File

@@ -61,7 +61,7 @@
v0.4.9 v0.4.9
v0.4.10 v0.4.10
v0.4.11 v0.4.11
v0.4.12  v0.4.12
v0.5.0 v0.5.0
v0.5.1 v0.5.1
v0.5.2 v0.5.2
@@ -72,7 +72,7 @@
v0.5.7 v0.5.7
v0.5.8 v0.5.8
v0.5.9 v0.5.9
v0.5.10  v0.5.10
v0.6.0 v0.6.0
v0.6.1 v0.6.1
v0.6.2 v0.6.2
@@ -94,20 +94,20 @@
v0.6.18 v0.6.18
v0.6.19 v0.6.19
v0.6.20 v0.6.20
v0.6.21  v0.6.21
v0.7.0 v0.7.0
v0.7.1 v0.7.1
v0.7.2 v0.7.2
v0.7.3 v0.7.3
v0.7.4 v0.7.4
v0.7.5  v0.7.5
v0.7.6  v0.7.6
v0.7.7  v0.7.7
v0.7.8 v0.7.8
v0.7.9 v0.7.9
v0.7.10 v0.7.10
v0.7.11 v0.7.11
v0.7.12  v0.7.12
v0.8.0 v0.8.0
v0.8.1 v0.8.1
v0.8.2 v0.8.2
@@ -135,8 +135,8 @@
v0.8.24 v0.8.24
v0.8.25 v0.8.25
v0.8.26 v0.8.26
v0.8.27  v0.8.27
v0.8.28  v0.8.28
v0.9.0 v0.9.0
v0.9.1 v0.9.1
v0.9.2 v0.9.2
@@ -149,7 +149,7 @@
v0.9.9 v0.9.9
v0.9.10 v0.9.10
v0.9.11 v0.9.11
v0.9.12  v0.9.12
v0.10.0 v0.10.0
v0.10.1 v0.10.1
v0.10.2 v0.10.2
@@ -198,8 +198,8 @@
v0.10.45 v0.10.45
v0.10.46 v0.10.46
v0.10.47 v0.10.47
v0.10.48  v0.10.48
v0.11.0  v0.11.0
v0.11.1 v0.11.1
v0.11.2 v0.11.2
v0.11.3 v0.11.3
@@ -213,10 +213,10 @@
v0.11.11 v0.11.11
v0.11.12 v0.11.12
v0.11.13 v0.11.13
v0.11.14  v0.11.14
v0.11.15  v0.11.15
v0.11.16  v0.11.16
v0.12.0  v0.12.0
v0.12.1 v0.12.1
v0.12.2 v0.12.2
v0.12.3 v0.12.3
@@ -234,12 +234,12 @@
v0.12.15 v0.12.15
v0.12.16 v0.12.16
v0.12.17 v0.12.17
v0.12.18  v0.12.18
iojs-v1.0.0 iojs-v1.0.0
iojs-v1.0.1 iojs-v1.0.1
iojs-v1.0.2 iojs-v1.0.2
iojs-v1.0.3 iojs-v1.0.3
iojs-v1.0.4  iojs-v1.0.4
iojs-v1.1.0 iojs-v1.1.0
iojs-v1.2.0 iojs-v1.2.0
iojs-v1.3.0 iojs-v1.3.0
@@ -257,7 +257,7 @@
iojs-v1.8.1 iojs-v1.8.1
iojs-v1.8.2 iojs-v1.8.2
iojs-v1.8.3 iojs-v1.8.3
iojs-v1.8.4  iojs-v1.8.4
iojs-v2.0.0 iojs-v2.0.0
iojs-v2.0.1 iojs-v2.0.1
iojs-v2.0.2 iojs-v2.0.2
@@ -270,13 +270,13 @@
iojs-v2.3.3 iojs-v2.3.3
iojs-v2.3.4 iojs-v2.3.4
iojs-v2.4.0 iojs-v2.4.0
iojs-v2.5.0  iojs-v2.5.0
iojs-v3.0.0  iojs-v3.0.0
iojs-v3.1.0  iojs-v3.1.0
iojs-v3.2.0  iojs-v3.2.0
iojs-v3.3.0 iojs-v3.3.0
iojs-v3.3.1  iojs-v3.3.1
v4.0.0  v4.0.0
v4.1.0 v4.1.0
v4.1.1 v4.1.1
v4.1.2 v4.1.2
@@ -315,8 +315,8 @@
v4.8.6  (LTS: Argon) v4.8.6  (LTS: Argon)
v4.8.7  (LTS: Argon) v4.8.7  (LTS: Argon)
v4.9.0  (LTS: Argon) v4.9.0  (LTS: Argon)
v4.9.1  (Latest LTS: Argon)  v4.9.1  (Latest LTS: Argon)
v5.0.0  v5.0.0
v5.1.0 v5.1.0
v5.1.1 v5.1.1
v5.2.0 v5.2.0
@@ -329,17 +329,17 @@
v5.7.1 v5.7.1
v5.8.0 v5.8.0
v5.9.0 v5.9.0
v5.9.1  v5.9.1
v5.10.0 v5.10.0
v5.10.1 v5.10.1
v5.11.0 v5.11.0
v5.11.1 v5.11.1
v5.12.0  v5.12.0
v6.0.0  v6.0.0
v6.1.0  v6.1.0
v6.2.0 v6.2.0
v6.2.1 v6.2.1
v6.2.2  v6.2.2
v6.3.0 v6.3.0
v6.3.1 v6.3.1
v6.4.0 v6.4.0
@@ -371,9 +371,17 @@
v6.13.0  (LTS: Boron) v6.13.0  (LTS: Boron)
v6.13.1  (LTS: Boron) v6.13.1  (LTS: Boron)
v6.14.0  (LTS: Boron) v6.14.0  (LTS: Boron)
v6.14.1  (Latest LTS: Boron) v6.14.1  (LTS: Boron)
v6.14.2  (LTS: Boron)
v6.14.3  (LTS: Boron)
v6.14.4  (LTS: Boron)
v6.15.0  (LTS: Boron)
v6.15.1  (LTS: Boron)
v6.16.0  (LTS: Boron)
v6.17.0  (LTS: Boron)
 v6.17.1  (Latest LTS: Boron)
v7.0.0 v7.0.0
v7.1.0  v7.1.0
v7.2.0 v7.2.0
v7.2.1 v7.2.1
v7.3.0 v7.3.0
@@ -388,8 +396,8 @@
v7.8.0 v7.8.0
v7.9.0 v7.9.0
v7.10.0 v7.10.0
v7.10.1  v7.10.1
v8.0.0  v8.0.0
v8.1.0 v8.1.0
v8.1.1 v8.1.1
v8.1.2 v8.1.2
@@ -397,7 +405,7 @@
v8.1.4 v8.1.4
v8.2.0 v8.2.0
v8.2.1 v8.2.1
v8.3.0  v8.3.0
v8.4.0 v8.4.0
v8.5.0 v8.5.0
v8.6.0 v8.6.0
@@ -411,8 +419,21 @@
v8.9.4  (LTS: Carbon) v8.9.4  (LTS: Carbon)
v8.10.0  (LTS: Carbon) v8.10.0  (LTS: Carbon)
v8.11.0  (LTS: Carbon) v8.11.0  (LTS: Carbon)
v8.11.1  (Latest LTS: Carbon) v8.11.1  (LTS: Carbon)
v9.0.0 v8.11.2  (LTS: Carbon)
v8.11.3  (LTS: Carbon)
v8.11.4  (LTS: Carbon)
v8.12.0  (LTS: Carbon)
v8.13.0  (LTS: Carbon)
v8.14.0  (LTS: Carbon)
v8.14.1  (LTS: Carbon)
v8.15.0  (LTS: Carbon)
v8.15.1  (LTS: Carbon)
v8.16.0  (LTS: Carbon)
v8.16.1  (LTS: Carbon)
 v8.16.2  (LTS: Carbon)
 v8.17.0  (Latest LTS: Carbon)
 v9.0.0
v9.1.0 v9.1.0
v9.2.0 v9.2.0
v9.2.1 v9.2.1
@@ -429,3 +450,249 @@
v9.10.1 v9.10.1
v9.11.0 v9.11.0
v9.11.1 v9.11.1
 v9.11.2
 v10.0.0
 v10.1.0
v10.2.0
 v10.2.1
v10.3.0
v10.4.0
v10.4.1
v10.5.0
v10.6.0
v10.7.0
 v10.8.0
 v10.9.0
 v10.10.0
v10.11.0
v10.12.0
v10.13.0  (LTS: Dubnium)
v10.14.0  (LTS: Dubnium)
v10.14.1  (LTS: Dubnium)
v10.14.2  (LTS: Dubnium)
v10.15.0  (LTS: Dubnium)
v10.15.1  (LTS: Dubnium)
v10.15.2  (LTS: Dubnium)
v10.15.3  (LTS: Dubnium)
v10.16.0  (LTS: Dubnium)
v10.16.1  (LTS: Dubnium)
v10.16.2  (LTS: Dubnium)
 v10.16.3  (LTS: Dubnium)
 v10.17.0  (LTS: Dubnium)
v10.18.0  (LTS: Dubnium)
v10.18.1  (LTS: Dubnium)
v10.19.0  (LTS: Dubnium)
v10.20.0  (LTS: Dubnium)
 v10.20.1  (LTS: Dubnium)
 v10.21.0  (LTS: Dubnium)
 v10.22.0  (LTS: Dubnium)
 v10.22.1  (LTS: Dubnium)
 v10.23.0  (LTS: Dubnium)
v10.23.1  (LTS: Dubnium)
v10.23.2  (LTS: Dubnium)
v10.23.3  (LTS: Dubnium)
v10.24.0  (LTS: Dubnium)
 v10.24.1  (Latest LTS: Dubnium)
v11.0.0
v11.1.0
v11.2.0
v11.3.0
v11.4.0
v11.5.0
v11.6.0
v11.7.0
v11.8.0
v11.9.0
v11.10.0
v11.10.1
v11.11.0
v11.12.0
 v11.13.0
 v11.14.0
 v11.15.0
 v12.0.0
 v12.1.0
 v12.2.0
v12.3.0
 v12.3.1
 v12.4.0
 v12.5.0
 v12.6.0
 v12.7.0
 v12.8.0
 v12.8.1
v12.9.0
 v12.9.1
 v12.10.0
v12.11.0
 v12.11.1
 v12.12.0
v12.13.0  (LTS: Erbium)
 v12.13.1  (LTS: Erbium)
v12.14.0  (LTS: Erbium)
 v12.14.1  (LTS: Erbium)
 v12.15.0  (LTS: Erbium)
 v12.16.0  (LTS: Erbium)
 v12.16.1  (LTS: Erbium)
v12.16.2  (LTS: Erbium)
 v12.16.3  (LTS: Erbium)
 v12.17.0  (LTS: Erbium)
v12.18.0  (LTS: Erbium)
v12.18.1  (LTS: Erbium)
v12.18.2  (LTS: Erbium)
v12.18.3  (LTS: Erbium)
 v12.18.4  (LTS: Erbium)
v12.19.0  (LTS: Erbium)
 v12.19.1  (LTS: Erbium)
v12.20.0  (LTS: Erbium)
v12.20.1  (LTS: Erbium)
 v12.20.2  (LTS: Erbium)
 v12.21.0  (LTS: Erbium)
v12.22.0  (LTS: Erbium)
v12.22.1  (LTS: Erbium)
v12.22.2  (LTS: Erbium)
v12.22.3  (LTS: Erbium)
v12.22.4  (LTS: Erbium)
v12.22.5  (LTS: Erbium)
v12.22.6  (LTS: Erbium)
v12.22.7  (LTS: Erbium)
v12.22.8  (LTS: Erbium)
v12.22.9  (LTS: Erbium)
v12.22.10  (LTS: Erbium)
v12.22.11  (LTS: Erbium)
 v12.22.12  (Latest LTS: Erbium)
 v13.0.0
 v13.0.1
 v13.1.0
 v13.2.0
 v13.3.0
 v13.4.0
 v13.5.0
 v13.6.0
 v13.7.0
 v13.8.0
 v13.9.0
v13.10.0
 v13.10.1
 v13.11.0
 v13.12.0
 v13.13.0
 v13.14.0
 v14.0.0
 v14.1.0
 v14.2.0
 v14.3.0
 v14.4.0
 v14.5.0
 v14.6.0
 v14.7.0
 v14.8.0
 v14.9.0
v14.10.0
 v14.10.1
 v14.11.0
 v14.12.0
 v14.13.0
 v14.13.1
 v14.14.0
v14.15.0  (LTS: Fermium)
v14.15.1  (LTS: Fermium)
v14.15.2  (LTS: Fermium)
v14.15.3  (LTS: Fermium)
v14.15.4  (LTS: Fermium)
 v14.15.5  (LTS: Fermium)
v14.16.0  (LTS: Fermium)
 v14.16.1  (LTS: Fermium)
v14.17.0  (LTS: Fermium)
v14.17.1  (LTS: Fermium)
v14.17.2  (LTS: Fermium)
v14.17.3  (LTS: Fermium)
v14.17.4  (LTS: Fermium)
v14.17.5  (LTS: Fermium)
 v14.17.6  (LTS: Fermium)
v14.18.0  (LTS: Fermium)
v14.18.1  (LTS: Fermium)
v14.18.2  (LTS: Fermium)
 v14.18.3  (LTS: Fermium)
v14.19.0  (LTS: Fermium)
v14.19.1  (LTS: Fermium)
v14.19.2  (LTS: Fermium)
 v14.19.3  (LTS: Fermium)
 v14.20.0  (LTS: Fermium)
 v14.20.1  (Latest LTS: Fermium)
v15.0.0
 v15.0.1
 v15.1.0
v15.2.0
 v15.2.1
 v15.3.0
v15.4.0
v15.5.0
 v15.5.1
v15.6.0
v15.7.0
v15.8.0
v15.9.0
 v15.10.0
v15.11.0
v15.12.0
 v15.13.0
 v15.14.0
 v16.0.0
 v16.1.0
 v16.2.0
 v16.3.0
v16.4.0
v16.4.1
 v16.4.2
 v16.5.0
v16.6.0
v16.6.1
 v16.6.2
 v16.7.0
 v16.8.0
v16.9.0
 v16.9.1
 v16.10.0
v16.11.0
 v16.11.1
 v16.12.0
v16.13.0  (LTS: Gallium)
v16.13.1  (LTS: Gallium)
 v16.13.2  (LTS: Gallium)
v16.14.0  (LTS: Gallium)
v16.14.1  (LTS: Gallium)
 v16.14.2  (LTS: Gallium)
v16.15.0  (LTS: Gallium)
 v16.15.1  (LTS: Gallium)
 v16.16.0  (LTS: Gallium)
v16.17.0  (LTS: Gallium)
 v16.17.1  (LTS: Gallium)
 v16.18.0  (Latest LTS: Gallium)
v17.0.0
 v17.0.1
 v17.1.0
 v17.2.0
v17.3.0
 v17.3.1
 v17.4.0
 v17.5.0
 v17.6.0
 v17.7.0
v17.7.1
 v17.7.2
 v17.8.0
v17.9.0
 v17.9.1
 v18.0.0
 v18.1.0
 v18.2.0
 v18.3.0
 v18.4.0
 v18.5.0
 v18.6.0
 v18.7.0
 v18.8.0
 v18.9.0
 v18.9.1
 v18.10.0

Some files were not shown because too many files have changed in this diff Show More