netcron 1.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of netcron might be problematic. Click here for more details.

Files changed (425) hide show
  1. package/.cache/replit/__replit_disk_meta.json +1 -0
  2. package/.cache/replit/nix/env.json +1 -0
  3. package/.config/configstore/update-notifier-npm.json +4 -0
  4. package/.config/configstore/update-notifier-npm.json.1735545094 +4 -0
  5. package/.config/nvm/.dockerignore +16 -0
  6. package/.config/nvm/.editorconfig +28 -0
  7. package/.config/nvm/.gitattributes +1 -0
  8. package/.config/nvm/.github/FUNDING.yml +12 -0
  9. package/.config/nvm/.github/ISSUE_TEMPLATE.md +44 -0
  10. package/.config/nvm/.github/SECURITY.md +3 -0
  11. package/.config/nvm/.github/workflows/latest-npm.yml +81 -0
  12. package/.config/nvm/.github/workflows/lint.yml +77 -0
  13. package/.config/nvm/.github/workflows/rebase.yml +23 -0
  14. package/.config/nvm/.github/workflows/release.yml +32 -0
  15. package/.config/nvm/.github/workflows/require-allow-edits.yml +21 -0
  16. package/.config/nvm/.github/workflows/shellcheck.yml +58 -0
  17. package/.config/nvm/.github/workflows/tests.yml +56 -0
  18. package/.config/nvm/.github/workflows/toc.yml +37 -0
  19. package/.config/nvm/.github/workflows/windows-npm.yml +134 -0
  20. package/.config/nvm/.mailmap +1 -0
  21. package/.config/nvm/.travis.yml +100 -0
  22. package/.config/nvm/CODE_OF_CONDUCT.md +125 -0
  23. package/.config/nvm/CONTRIBUTING.md +115 -0
  24. package/.config/nvm/Dockerfile +111 -0
  25. package/.config/nvm/GOVERNANCE.md +10 -0
  26. package/.config/nvm/LICENSE.md +22 -0
  27. package/.config/nvm/Makefile +85 -0
  28. package/.config/nvm/PROJECT_CHARTER.md +49 -0
  29. package/.config/nvm/README.md +1047 -0
  30. package/.config/nvm/ROADMAP.md +9 -0
  31. package/.config/nvm/bash_completion +99 -0
  32. package/.config/nvm/install.sh +479 -0
  33. package/.config/nvm/nvm-exec +17 -0
  34. package/.config/nvm/nvm.sh +4417 -0
  35. package/.config/nvm/package.json +51 -0
  36. package/.config/nvm/rename_test.sh +52 -0
  37. package/.config/nvm/test/common.sh +103 -0
  38. package/.config/nvm/test/fast/Aliases/'nvm alias' should not accept aliases with slashes +26 -0
  39. package/.config/nvm/test/fast/Aliases/'nvm unalias' should accept aliases when they shadow a built-in alias +17 -0
  40. package/.config/nvm/test/fast/Aliases/'nvm unalias' should not accept aliases with names equal to built-in alias +25 -0
  41. package/.config/nvm/test/fast/Aliases/'nvm unalias' should not accept aliases with slashes +26 -0
  42. package/.config/nvm/test/fast/Aliases/Running 'nvm alias /313/202aliasname/313/203 /313/202target/313/203' again should change the target" +24 -0
  43. package/.config/nvm/test/fast/Aliases/Running 'nvm alias /313/202aliasname/313/203' should list but one alias" +4 -0
  44. package/.config/nvm/test/fast/Aliases/Running 'nvm alias' lists implicit aliases when they do not exist +26 -0
  45. package/.config/nvm/test/fast/Aliases/Running 'nvm alias' lists manual aliases instead of implicit aliases when present +49 -0
  46. package/.config/nvm/test/fast/Aliases/Running 'nvm alias' should list all aliases +48 -0
  47. package/.config/nvm/test/fast/Aliases/circular/nvm_resolve_alias +36 -0
  48. package/.config/nvm/test/fast/Aliases/circular/nvm_resolve_local_alias +36 -0
  49. package/.config/nvm/test/fast/Aliases/circular/setup +9 -0
  50. package/.config/nvm/test/fast/Aliases/circular/teardown +9 -0
  51. package/.config/nvm/test/fast/Aliases/lts/'nvm alias' should ensure LTS alias dir exists +18 -0
  52. package/.config/nvm/test/fast/Aliases/lts/setup_dir +10 -0
  53. package/.config/nvm/test/fast/Aliases/lts/teardown_dir +10 -0
  54. package/.config/nvm/test/fast/Aliases/nvm_ensure_default_set +20 -0
  55. package/.config/nvm/test/fast/Aliases/nvm_list_aliases calls nvm_get_colors +22 -0
  56. package/.config/nvm/test/fast/Aliases/nvm_list_aliases works with LTS aliases +31 -0
  57. package/.config/nvm/test/fast/Aliases/nvm_list_aliases works with no LTS aliases present +21 -0
  58. package/.config/nvm/test/fast/Aliases/nvm_print_alias_path calls nvm_get_colors +28 -0
  59. package/.config/nvm/test/fast/Aliases/nvm_print_formatted_alias calls nvm_get_colors +21 -0
  60. package/.config/nvm/test/fast/Aliases/nvm_resolve_alias +33 -0
  61. package/.config/nvm/test/fast/Aliases/nvm_resolve_local_alias +35 -0
  62. package/.config/nvm/test/fast/Aliases/setup +16 -0
  63. package/.config/nvm/test/fast/Aliases/teardown +17 -0
  64. package/.config/nvm/test/fast/Listing paths/Running 'nvm which 0.0.2' should display only version 0.0.2 +27 -0
  65. package/.config/nvm/test/fast/Listing paths/Running 'nvm which foo' should return a nonzero exit code when not found +6 -0
  66. package/.config/nvm/test/fast/Listing paths/teardown +3 -0
  67. package/.config/nvm/test/fast/Listing versions/Running 'nvm ls --no-alias' does not call into nvm_alias +34 -0
  68. package/.config/nvm/test/fast/Listing versions/Running 'nvm ls --no-alias' with a pattern errors +15 -0
  69. package/.config/nvm/test/fast/Listing versions/Running 'nvm ls 0.0.2' should display only version 0.0.2 +21 -0
  70. package/.config/nvm/test/fast/Listing versions/Running 'nvm ls 0.2' should display only 0.2.x versions +42 -0
  71. package/.config/nvm/test/fast/Listing versions/Running 'nvm ls foo' should return a nonzero exit code when not found +6 -0
  72. package/.config/nvm/test/fast/Listing versions/Running 'nvm ls io' should return NA +6 -0
  73. package/.config/nvm/test/fast/Listing versions/Running 'nvm ls node_' should return a nonzero exit code when not found +6 -0
  74. package/.config/nvm/test/fast/Listing versions/Running 'nvm ls stable' and 'nvm ls unstable' should return the appropriate implicit alias +29 -0
  75. package/.config/nvm/test/fast/Listing versions/Running 'nvm ls system' should include 'system' when appropriate +21 -0
  76. package/.config/nvm/test/fast/Listing versions/Running 'nvm ls' calls into nvm_alias +35 -0
  77. package/.config/nvm/test/fast/Listing versions/Running 'nvm ls' should display all installed versions +44 -0
  78. package/.config/nvm/test/fast/Listing versions/Running 'nvm ls' should filter out '.nvm' +10 -0
  79. package/.config/nvm/test/fast/Listing versions/Running 'nvm ls' should filter out 'versions' +10 -0
  80. package/.config/nvm/test/fast/Listing versions/Running 'nvm ls' should include 'system' when appropriate +21 -0
  81. package/.config/nvm/test/fast/Listing versions/Running 'nvm ls' should list versions in the 'versions' directory +12 -0
  82. package/.config/nvm/test/fast/Listing versions/Running 'nvm ls' should not show a trailing slash +42 -0
  83. package/.config/nvm/test/fast/Listing versions/Running 'nvm ls' with node-like versioning vx.x.x should only list a matched version +11 -0
  84. package/.config/nvm/test/fast/Listing versions/Running 'nvm ls' with nounset should not fail +23 -0
  85. package/.config/nvm/test/fast/Listing versions/Using a nonstandard IFS should not break +19 -0
  86. package/.config/nvm/test/fast/Listing versions/teardown +16 -0
  87. package/.config/nvm/test/fast/Running 'nvm alias' should create a file in the alias directory +11 -0
  88. package/.config/nvm/test/fast/Running 'nvm current' should display current nvm environment +13 -0
  89. package/.config/nvm/test/fast/Running 'nvm deactivate' should unset the nvm environment variables +25 -0
  90. package/.config/nvm/test/fast/Running 'nvm install' with '--reinstall-packages-from' requires a valid version +59 -0
  91. package/.config/nvm/test/fast/Running 'nvm install' with an invalid version fails nicely +15 -0
  92. package/.config/nvm/test/fast/Running 'nvm unalias' should remove the alias file +13 -0
  93. package/.config/nvm/test/fast/Running 'nvm uninstall' should remove the appropriate directory +12 -0
  94. package/.config/nvm/test/fast/Running 'nvm uninstall' with incorrect file permissions fails nicely +14 -0
  95. package/.config/nvm/test/fast/Running 'nvm unload' should unset all function and variables +30 -0
  96. package/.config/nvm/test/fast/Running 'nvm use foo' where 'foo' is circular aborts +39 -0
  97. package/.config/nvm/test/fast/Running 'nvm use iojs' uses latest io.js version +37 -0
  98. package/.config/nvm/test/fast/Running 'nvm use system' should work as expected +44 -0
  99. package/.config/nvm/test/fast/Running 'nvm use x' should create and change the 'current' symlink +36 -0
  100. package/.config/nvm/test/fast/Running 'nvm use x' should not create the 'current' symlink if $NVM_SYMLINK_CURRENT is false +86 -0
  101. package/.config/nvm/test/fast/Running 'nvm use' should drop CR char automatically +33 -0
  102. package/.config/nvm/test/fast/Set Colors/nvm_echo_with_colors +21 -0
  103. package/.config/nvm/test/fast/Set Colors/nvm_err_with_colors +19 -0
  104. package/.config/nvm/test/fast/Set Colors/nvm_print_default_alias calls nvm_get_colors +24 -0
  105. package/.config/nvm/test/fast/Set Colors/nvm_print_versions calls nvm_get_colors +52 -0
  106. package/.config/nvm/test/fast/Sourcing nvm.sh should make the nvm command available +7 -0
  107. package/.config/nvm/test/fast/Sourcing nvm.sh should not modify parameters of caller +7 -0
  108. package/.config/nvm/test/fast/Unit tests/mocks/LTS_names.txt +8 -0
  109. package/.config/nvm/test/fast/Unit tests/mocks/iojs.org-dist-index.tab +42 -0
  110. package/.config/nvm/test/fast/Unit tests/mocks/lts-star.txt +1 -0
  111. package/.config/nvm/test/fast/Unit tests/mocks/nodejs.org-dist-index.tab +671 -0
  112. package/.config/nvm/test/fast/Unit tests/mocks/nodejs.org-download-nightly-index.tab +2915 -0
  113. package/.config/nvm/test/fast/Unit tests/mocks/nvm ls-remote iojs.txt +41 -0
  114. package/.config/nvm/test/fast/Unit tests/mocks/nvm ls-remote lts.txt +194 -0
  115. package/.config/nvm/test/fast/Unit tests/mocks/nvm ls-remote node.txt +670 -0
  116. package/.config/nvm/test/fast/Unit tests/mocks/nvm ls-remote.txt +711 -0
  117. package/.config/nvm/test/fast/Unit tests/mocks/nvm_ls_remote LTS argon.txt +36 -0
  118. package/.config/nvm/test/fast/Unit tests/mocks/nvm_ls_remote LTS nightly argon.txt +1 -0
  119. package/.config/nvm/test/fast/Unit tests/mocks/nvm_ls_remote LTS nightly.txt +26 -0
  120. package/.config/nvm/test/fast/Unit tests/mocks/nvm_ls_remote LTS.txt +194 -0
  121. package/.config/nvm/test/fast/Unit tests/mocks/nvm_ls_remote nightly.txt +150 -0
  122. package/.config/nvm/test/fast/Unit tests/mocks/nvm_ls_remote stable nightly.txt +1 -0
  123. package/.config/nvm/test/fast/Unit tests/mocks/nvm_ls_remote stable.txt +1 -0
  124. package/.config/nvm/test/fast/Unit tests/mocks/nvm_ls_remote.txt +670 -0
  125. package/.config/nvm/test/fast/Unit tests/mocks/nvm_ls_remote_iojs.txt +41 -0
  126. package/.config/nvm/test/fast/Unit tests/mocks/nvm_make_alias LTS alias calls.txt +9 -0
  127. package/.config/nvm/test/fast/Unit tests/mocks/nvm_print_implicit_alias remote stable nightly.txt +1 -0
  128. package/.config/nvm/test/fast/Unit tests/mocks/nvm_print_implicit_alias remote stable.txt +1 -0
  129. package/.config/nvm/test/fast/Unit tests/mocks/project_dirs/nested-both/a/b/c/d/.gitkeep +0 -0
  130. package/.config/nvm/test/fast/Unit tests/mocks/project_dirs/nested-both/package.json +0 -0
  131. package/.config/nvm/test/fast/Unit tests/mocks/project_dirs/nested-n_m/a/b/c/d/.gitkeep +0 -0
  132. package/.config/nvm/test/fast/Unit tests/mocks/project_dirs/nested-pkg/a/b/c/d/.gitkeep +0 -0
  133. package/.config/nvm/test/fast/Unit tests/mocks/project_dirs/nested-pkg/package.json +0 -0
  134. package/.config/nvm/test/fast/Unit tests/mocks/project_dirs/no-nesting-both/package.json +0 -0
  135. package/.config/nvm/test/fast/Unit tests/mocks/project_dirs/no-nesting-pkg/package.json +0 -0
  136. package/.config/nvm/test/fast/Unit tests/nvm ls-remote +73 -0
  137. package/.config/nvm/test/fast/Unit tests/nvm set_colors +52 -0
  138. package/.config/nvm/test/fast/Unit tests/nvm version-remote +51 -0
  139. package/.config/nvm/test/fast/Unit tests/nvm_add_iojs_prefix +9 -0
  140. package/.config/nvm/test/fast/Unit tests/nvm_alias +32 -0
  141. package/.config/nvm/test/fast/Unit tests/nvm_alias LTS-N +36 -0
  142. package/.config/nvm/test/fast/Unit tests/nvm_alias_path +7 -0
  143. package/.config/nvm/test/fast/Unit tests/nvm_change_path +57 -0
  144. package/.config/nvm/test/fast/Unit tests/nvm_check_for_help +9 -0
  145. package/.config/nvm/test/fast/Unit tests/nvm_clang_version +62 -0
  146. package/.config/nvm/test/fast/Unit tests/nvm_command_info +58 -0
  147. package/.config/nvm/test/fast/Unit tests/nvm_compare_checksum +72 -0
  148. package/.config/nvm/test/fast/Unit tests/nvm_compute_checksum +23 -0
  149. package/.config/nvm/test/fast/Unit tests/nvm_curl_libz_support +39 -0
  150. package/.config/nvm/test/fast/Unit tests/nvm_curl_use_compression +38 -0
  151. package/.config/nvm/test/fast/Unit tests/nvm_curl_version +32 -0
  152. package/.config/nvm/test/fast/Unit tests/nvm_die_on_prefix +192 -0
  153. package/.config/nvm/test/fast/Unit tests/nvm_download +18 -0
  154. package/.config/nvm/test/fast/Unit tests/nvm_download_artifact +55 -0
  155. package/.config/nvm/test/fast/Unit tests/nvm_ensure_default_set +15 -0
  156. package/.config/nvm/test/fast/Unit tests/nvm_ensure_version_installed +72 -0
  157. package/.config/nvm/test/fast/Unit tests/nvm_ensure_version_prefix +12 -0
  158. package/.config/nvm/test/fast/Unit tests/nvm_extract_tarball +12 -0
  159. package/.config/nvm/test/fast/Unit tests/nvm_find_project_dir +36 -0
  160. package/.config/nvm/test/fast/Unit tests/nvm_find_up +26 -0
  161. package/.config/nvm/test/fast/Unit tests/nvm_format_version +20 -0
  162. package/.config/nvm/test/fast/Unit tests/nvm_get_arch +85 -0
  163. package/.config/nvm/test/fast/Unit tests/nvm_get_artifact_compression +22 -0
  164. package/.config/nvm/test/fast/Unit tests/nvm_get_checksum +45 -0
  165. package/.config/nvm/test/fast/Unit tests/nvm_get_checksum_alg +20 -0
  166. package/.config/nvm/test/fast/Unit tests/nvm_get_checksum_binary +20 -0
  167. package/.config/nvm/test/fast/Unit tests/nvm_get_colors +79 -0
  168. package/.config/nvm/test/fast/Unit tests/nvm_get_default_packages +92 -0
  169. package/.config/nvm/test/fast/Unit tests/nvm_get_download_slug +111 -0
  170. package/.config/nvm/test/fast/Unit tests/nvm_get_latest missing curl or wget +20 -0
  171. package/.config/nvm/test/fast/Unit tests/nvm_get_minor_version +45 -0
  172. package/.config/nvm/test/fast/Unit tests/nvm_get_mirror +32 -0
  173. package/.config/nvm/test/fast/Unit tests/nvm_has +11 -0
  174. package/.config/nvm/test/fast/Unit tests/nvm_has_non_aliased +24 -0
  175. package/.config/nvm/test/fast/Unit tests/nvm_has_solaris_binary +32 -0
  176. package/.config/nvm/test/fast/Unit tests/nvm_has_system_iojs +27 -0
  177. package/.config/nvm/test/fast/Unit tests/nvm_has_system_node +27 -0
  178. package/.config/nvm/test/fast/Unit tests/nvm_install_binary_extract +59 -0
  179. package/.config/nvm/test/fast/Unit tests/nvm_install_binary_nosource +30 -0
  180. package/.config/nvm/test/fast/Unit tests/nvm_install_latest_npm +58 -0
  181. package/.config/nvm/test/fast/Unit tests/nvm_install_no_progress_bar +43 -0
  182. package/.config/nvm/test/fast/Unit tests/nvm_iojs_prefix +7 -0
  183. package/.config/nvm/test/fast/Unit tests/nvm_iojs_version_has_solaris_binary +17 -0
  184. package/.config/nvm/test/fast/Unit tests/nvm_is_alias +20 -0
  185. package/.config/nvm/test/fast/Unit tests/nvm_is_iojs_version +10 -0
  186. package/.config/nvm/test/fast/Unit tests/nvm_is_merged_node_version +10 -0
  187. package/.config/nvm/test/fast/Unit tests/nvm_is_natural_num +17 -0
  188. package/.config/nvm/test/fast/Unit tests/nvm_is_valid_version +13 -0
  189. package/.config/nvm/test/fast/Unit tests/nvm_is_version_installed +54 -0
  190. package/.config/nvm/test/fast/Unit tests/nvm_ls_current +39 -0
  191. package/.config/nvm/test/fast/Unit tests/nvm_ls_remote +86 -0
  192. package/.config/nvm/test/fast/Unit tests/nvm_ls_remote LTS aliases +49 -0
  193. package/.config/nvm/test/fast/Unit tests/nvm_ls_remote nightly +65 -0
  194. package/.config/nvm/test/fast/Unit tests/nvm_ls_remote_iojs +37 -0
  195. package/.config/nvm/test/fast/Unit tests/nvm_make_alias +19 -0
  196. package/.config/nvm/test/fast/Unit tests/nvm_node_prefix +7 -0
  197. package/.config/nvm/test/fast/Unit tests/nvm_node_version_has_solaris_binary +33 -0
  198. package/.config/nvm/test/fast/Unit tests/nvm_normalize_lts +38 -0
  199. package/.config/nvm/test/fast/Unit tests/nvm_num_version_groups +24 -0
  200. package/.config/nvm/test/fast/Unit tests/nvm_print_alias_path +44 -0
  201. package/.config/nvm/test/fast/Unit tests/nvm_print_color_code +20 -0
  202. package/.config/nvm/test/fast/Unit tests/nvm_print_default_alias +38 -0
  203. package/.config/nvm/test/fast/Unit tests/nvm_print_implicit_alias errors +25 -0
  204. package/.config/nvm/test/fast/Unit tests/nvm_print_implicit_alias success +106 -0
  205. package/.config/nvm/test/fast/Unit tests/nvm_print_npm_version +28 -0
  206. package/.config/nvm/test/fast/Unit tests/nvm_remote_version +78 -0
  207. package/.config/nvm/test/fast/Unit tests/nvm_remote_versions +77 -0
  208. package/.config/nvm/test/fast/Unit tests/nvm_stdout_is_terminal +32 -0
  209. package/.config/nvm/test/fast/Unit tests/nvm_strip_iojs_prefix +10 -0
  210. package/.config/nvm/test/fast/Unit tests/nvm_strip_path +24 -0
  211. package/.config/nvm/test/fast/Unit tests/nvm_supports_xz +42 -0
  212. package/.config/nvm/test/fast/Unit tests/nvm_tree_contains_path +31 -0
  213. package/.config/nvm/test/fast/Unit tests/nvm_use_if_needed +24 -0
  214. package/.config/nvm/test/fast/Unit tests/nvm_validate_implicit_alias +20 -0
  215. package/.config/nvm/test/fast/Unit tests/nvm_version +48 -0
  216. package/.config/nvm/test/fast/Unit tests/nvm_version_dir +11 -0
  217. package/.config/nvm/test/fast/Unit tests/nvm_version_greater +15 -0
  218. package/.config/nvm/test/fast/Unit tests/nvm_version_path +14 -0
  219. package/.config/nvm/test/fast/Unit tests/nvm_wrap_with_color_code +1 -0
  220. package/.config/nvm/test/fast/nvm should remove the last trailing slash in $NVM_DIR +18 -0
  221. package/.config/nvm/test/fast/setup +14 -0
  222. package/.config/nvm/test/fast/setup_dir +18 -0
  223. package/.config/nvm/test/fast/teardown +12 -0
  224. package/.config/nvm/test/fast/teardown_dir +15 -0
  225. package/.config/nvm/test/install_script/install_nvm_from_git +129 -0
  226. package/.config/nvm/test/install_script/nvm_check_global_modules +65 -0
  227. package/.config/nvm/test/install_script/nvm_detect_profile +126 -0
  228. package/.config/nvm/test/install_script/nvm_do_install +18 -0
  229. package/.config/nvm/test/install_script/nvm_download +18 -0
  230. package/.config/nvm/test/install_script/nvm_install_dir +25 -0
  231. package/.config/nvm/test/install_script/nvm_install_with_aliased_dot +24 -0
  232. package/.config/nvm/test/install_script/nvm_install_with_node_version +12 -0
  233. package/.config/nvm/test/install_script/nvm_profile_is_bash_or_zsh +14 -0
  234. package/.config/nvm/test/install_script/nvm_reset +38 -0
  235. package/.config/nvm/test/install_script/nvm_source +43 -0
  236. package/.config/nvm/test/installation_iojs/install already installed uses it +25 -0
  237. package/.config/nvm/test/installation_iojs/install from binary +22 -0
  238. package/.config/nvm/test/installation_iojs/install from source +22 -0
  239. package/.config/nvm/test/installation_iojs/install two versions and use the latest one +25 -0
  240. package/.config/nvm/test/installation_iojs/install version specified in .nvmrc from binary +22 -0
  241. package/.config/nvm/test/installation_iojs/install version specified in .nvmrc from source +23 -0
  242. package/.config/nvm/test/installation_iojs/install while reinstalling packages +31 -0
  243. package/.config/nvm/test/installation_iojs/nvm install v1 works +19 -0
  244. package/.config/nvm/test/installation_iojs/setup_dir +5 -0
  245. package/.config/nvm/test/installation_iojs/teardown_dir +16 -0
  246. package/.config/nvm/test/installation_node/default-packages +123 -0
  247. package/.config/nvm/test/installation_node/install LTS +29 -0
  248. package/.config/nvm/test/installation_node/install already installed uses it +23 -0
  249. package/.config/nvm/test/installation_node/install from binary +23 -0
  250. package/.config/nvm/test/installation_node/install from binary with binary flag set +37 -0
  251. package/.config/nvm/test/installation_node/install from source +29 -0
  252. package/.config/nvm/test/installation_node/install from source with thread parameter +33 -0
  253. package/.config/nvm/test/installation_node/install from source without V8 snapshot for ARM +25 -0
  254. package/.config/nvm/test/installation_node/install hook +45 -0
  255. package/.config/nvm/test/installation_node/install latest npm +51 -0
  256. package/.config/nvm/test/installation_node/install on bash with ERR trap and set -E +50 -0
  257. package/.config/nvm/test/installation_node/install two versions and use the latest one +24 -0
  258. package/.config/nvm/test/installation_node/install version specified in .nvmrc from binary +20 -0
  259. package/.config/nvm/test/installation_node/install while reinstalling packages +46 -0
  260. package/.config/nvm/test/installation_node/install with --alias +11 -0
  261. package/.config/nvm/test/installation_node/install with --default +11 -0
  262. package/.config/nvm/test/installation_node/install with --latest-npm +12 -0
  263. package/.config/nvm/test/installation_node/setup_dir +5 -0
  264. package/.config/nvm/test/installation_node/teardown_dir +18 -0
  265. package/.config/nvm/test/mocks/isainfo_amd64 +5 -0
  266. package/.config/nvm/test/mocks/isainfo_x86 +5 -0
  267. package/.config/nvm/test/mocks/pkg_info_amd64 +4 -0
  268. package/.config/nvm/test/mocks/pkg_info_fail +1 -0
  269. package/.config/nvm/test/mocks/pkg_info_x86 +1 -0
  270. package/.config/nvm/test/mocks/uname_linux_armv8l +5 -0
  271. package/.config/nvm/test/mocks/uname_osx_amd64 +5 -0
  272. package/.config/nvm/test/mocks/uname_osx_x86 +5 -0
  273. package/.config/nvm/test/mocks/uname_smartos_amd64 +5 -0
  274. package/.config/nvm/test/mocks/uname_smartos_x86 +5 -0
  275. package/.config/nvm/test/slow/Running 'nvm current' should display current nvm environment +9 -0
  276. package/.config/nvm/test/slow/nvm exec/Preamble works and respects 'silent' flag +30 -0
  277. package/.config/nvm/test/slow/nvm exec/Running 'nvm exec --lts' should work +18 -0
  278. package/.config/nvm/test/slow/nvm exec/Running 'nvm exec 0.x' should work +15 -0
  279. package/.config/nvm/test/slow/nvm exec/Running 'nvm exec' should pick up .nvmrc version +16 -0
  280. package/.config/nvm/test/slow/nvm exec/Running 'nvm exec' with help should not parse +9 -0
  281. package/.config/nvm/test/slow/nvm exec/setup_dir +10 -0
  282. package/.config/nvm/test/slow/nvm exec/teardown_dir +13 -0
  283. package/.config/nvm/test/slow/nvm reinstall-packages/Running 'nvm copy-packages $(nvm ls current)' should error out +17 -0
  284. package/.config/nvm/test/slow/nvm reinstall-packages/setup_dir +11 -0
  285. package/.config/nvm/test/slow/nvm reinstall-packages/should work as expected +31 -0
  286. package/.config/nvm/test/slow/nvm reinstall-packages/teardown_dir +13 -0
  287. package/.config/nvm/test/slow/nvm reinstall-packages/test-npmlink/index.js +2 -0
  288. package/.config/nvm/test/slow/nvm reinstall-packages/test-npmlink/package.json +10 -0
  289. package/.config/nvm/test/slow/nvm reinstall-packages/works with no installs +18 -0
  290. package/.config/nvm/test/slow/nvm run/Running 'nvm run --harmony --version' should work +8 -0
  291. package/.config/nvm/test/slow/nvm run/Running 'nvm run --lts' should work +15 -0
  292. package/.config/nvm/test/slow/nvm run/Running 'nvm run 0.x' should error out sensibly when 0.x is not installed +16 -0
  293. package/.config/nvm/test/slow/nvm run/Running 'nvm run 0.x' should work +8 -0
  294. package/.config/nvm/test/slow/nvm run/Running 'nvm run' should pick up .nvmrc version +25 -0
  295. package/.config/nvm/test/slow/nvm run/setup_dir +11 -0
  296. package/.config/nvm/test/slow/nvm run/teardown_dir +14 -0
  297. package/.config/nvm/test/slow/nvm uninstall/Running 'nvm uninstall 0.12.6' uninstalls v0.12.6 +33 -0
  298. package/.config/nvm/test/slow/nvm uninstall/Running 'nvm uninstall' with incorrect file permissions fails nicely +30 -0
  299. package/.config/nvm/test/slow/nvm uninstall/setup_dir +4 -0
  300. package/.config/nvm/test/slow/nvm uninstall/teardown_dir +5 -0
  301. package/.config/nvm/test/slow/nvm use/Running 'nvm use --lts' uses latest LTS version +22 -0
  302. package/.config/nvm/test/slow/nvm use/Running 'nvm use --lts=foo' uses latest 'foo' LTS version +22 -0
  303. package/.config/nvm/test/slow/nvm use/Running 'nvm use iojs' uses latest io.js version +20 -0
  304. package/.config/nvm/test/slow/nvm use/Running 'nvm use node --silent' doesn't print anything +13 -0
  305. package/.config/nvm/test/slow/nvm use/Running 'nvm use node' uses latest stable node version +20 -0
  306. package/.config/nvm/test/slow/nvm use/Running 'nvm use v1.0.0' uses iojs-v1.0.0 iojs version +20 -0
  307. package/.config/nvm/test/slow/nvm use/Running 'nvm use' calls 'nvm_die_on_prefix' +22 -0
  308. package/.config/nvm/test/slow/nvm use/Running 'nvm use' with nvmrc containing not intalled version +28 -0
  309. package/.config/nvm/test/slow/nvm use/setup_dir +23 -0
  310. package/.config/nvm/test/slow/nvm use/teardown_dir +22 -0
  311. package/.config/nvm/test/slow/nvm_get_latest/nvm_get_latest +101 -0
  312. package/.config/nvm/test/slow/nvm_get_latest/nvm_get_latest failed redirect +25 -0
  313. package/.config/nvm/test/sourcing/Sourcing nvm.sh global alias bug +30 -0
  314. package/.config/nvm/test/sourcing/Sourcing nvm.sh should keep version if one is active +20 -0
  315. package/.config/nvm/test/sourcing/Sourcing nvm.sh should use the default if available and no nvm node is loaded +28 -0
  316. package/.config/nvm/test/sourcing/Sourcing nvm.sh with --install and .nvmrc should install it +27 -0
  317. package/.config/nvm/test/sourcing/Sourcing nvm.sh with --install should install the default +32 -0
  318. package/.config/nvm/test/sourcing/Sourcing nvm.sh with --no-use should not use anything +31 -0
  319. package/.config/nvm/test/sourcing/Sourcing nvm.sh with no default should return 0 +11 -0
  320. package/.config/nvm/test/sourcing/setup +14 -0
  321. package/.config/nvm/test/sourcing/teardown +7 -0
  322. package/.config/nvm/test/xenial/install from source +29 -0
  323. package/.config/nvm/test/xenial/install from source implicitly +23 -0
  324. package/.config/nvm/test/xenial/install from source with thread parameter +33 -0
  325. package/.config/nvm/test/xenial/install from source without V8 snapshot for ARM +25 -0
  326. package/.config/nvm/test/xenial/install hook +45 -0
  327. package/.config/nvm/test/xenial/install version specified in .nvmrc from source +20 -0
  328. package/.config/nvm/test/xenial/node 0.6.21 should install 0.6.21-pre +11 -0
  329. package/.config/nvm/update_test_mocks.sh +59 -0
  330. package/.gitattributes +2 -0
  331. package/.replit +84 -0
  332. package/.upm/store.json +1 -0
  333. package/Extra/Database/index.js +470 -0
  334. package/Extra/ExtraAddons.js +82 -0
  335. package/Extra/ExtraFindUID.js +62 -0
  336. package/Extra/ExtraGetThread.js +340 -0
  337. package/Extra/ExtraScreenShot.js +430 -0
  338. package/Extra/ExtraUptimeRobot.js +38 -0
  339. package/Extra/Html/Classic/script.js +833 -0
  340. package/Extra/Html/Classic/style.css +1222 -0
  341. package/Extra/Security/Index.js +173 -0
  342. package/Extra/Security/Step_1.js +6 -0
  343. package/Extra/Security/Step_2.js +22 -0
  344. package/Extra/Security/Step_3.js +22 -0
  345. package/Extra/Src/Change_Environment.js +24 -0
  346. package/Extra/Src/Check_Update.js +66 -0
  347. package/Extra/Src/History.js +115 -0
  348. package/Extra/Src/Instant_Update.js +64 -0
  349. package/Extra/Src/Last-Run.js +65 -0
  350. package/Extra/Src/Release_Memory.js +41 -0
  351. package/Extra/Src/image/checkmate.jpg +0 -0
  352. package/Extra/Src/uuid.js +137 -0
  353. package/Func/AcceptAgreement.js +31 -0
  354. package/Func/ClearCache.js +64 -0
  355. package/Func/ReportV1.js +54 -0
  356. package/Index.js +378 -0
  357. package/LICENSE +21 -0
  358. package/Language/index.json +224 -0
  359. package/Main.js +1110 -0
  360. package/README.md +144 -0
  361. package/broadcast.js +40 -0
  362. package/logger.js +66 -0
  363. package/package.json +231 -0
  364. package/replit.nix +8 -0
  365. package/src/Dev_Horizon_Data.js +125 -0
  366. package/src/Premium.js +25 -0
  367. package/src/Screenshot.js +83 -0
  368. package/src/addExternalModule.js +16 -0
  369. package/src/addUserToGroup.js +79 -0
  370. package/src/changeAdminStatus.js +79 -0
  371. package/src/changeArchivedStatus.js +41 -0
  372. package/src/changeAvt.js +85 -0
  373. package/src/changeBio.js +65 -0
  374. package/src/changeBlockedStatus.js +36 -0
  375. package/src/changeGroupImage.js +106 -0
  376. package/src/changeNickname.js +45 -0
  377. package/src/changeThreadColor.js +62 -0
  378. package/src/changeThreadEmoji.js +42 -0
  379. package/src/createNewGroup.js +70 -0
  380. package/src/createPoll.js +60 -0
  381. package/src/deleteMessage.js +45 -0
  382. package/src/deleteThread.js +43 -0
  383. package/src/forwardAttachment.js +48 -0
  384. package/src/getAccessToken.js +28 -0
  385. package/src/getCurrentUserID.js +7 -0
  386. package/src/getEmojiUrl.js +27 -0
  387. package/src/getFriendsList.js +73 -0
  388. package/src/getMessage.js +80 -0
  389. package/src/getThreadHistory.js +537 -0
  390. package/src/getThreadInfo.js +425 -0
  391. package/src/getThreadList.js +213 -0
  392. package/src/getThreadMain.js +220 -0
  393. package/src/getThreadPictures.js +59 -0
  394. package/src/getUID.js +59 -0
  395. package/src/getUserID.js +62 -0
  396. package/src/getUserInfo.js +113 -0
  397. package/src/getUserInfoMain.js +65 -0
  398. package/src/getUserInfoV2.js +32 -0
  399. package/src/getUserInfoV3.js +63 -0
  400. package/src/getUserInfoV4.js +55 -0
  401. package/src/getUserInfoV5.js +61 -0
  402. package/src/handleFriendRequest.js +46 -0
  403. package/src/handleMessageRequest.js +49 -0
  404. package/src/httpGet.js +49 -0
  405. package/src/httpPost.js +48 -0
  406. package/src/httpPostFormData.js +41 -0
  407. package/src/listenMqtt.js +786 -0
  408. package/src/logout.js +68 -0
  409. package/src/markAsDelivered.js +48 -0
  410. package/src/markAsRead.js +70 -0
  411. package/src/markAsReadAll.js +43 -0
  412. package/src/markAsSeen.js +51 -0
  413. package/src/muteThread.js +47 -0
  414. package/src/removeUserFromGroup.js +49 -0
  415. package/src/resolvePhotoUrl.js +37 -0
  416. package/src/searchForThread.js +43 -0
  417. package/src/sendMessage.js +379 -0
  418. package/src/sendTypingIndicator.js +80 -0
  419. package/src/setMessageReaction.js +109 -0
  420. package/src/setPostReaction.js +102 -0
  421. package/src/setTitle.js +74 -0
  422. package/src/threadColors.js +39 -0
  423. package/src/unfriend.js +43 -0
  424. package/src/unsendMessage.js +40 -0
  425. package/utils.js +1684 -0
@@ -0,0 +1,1047 @@
1
+ <a href="https://github.com/nvm-sh/logos">
2
+ <picture>
3
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/nvm-sh/logos/HEAD/nvm-logo-white.svg" />
4
+ <img src="https://raw.githubusercontent.com/nvm-sh/logos/HEAD/nvm-logo-color.svg" height="50" alt="nvm project logo" />
5
+ </picture>
6
+ </a>
7
+
8
+
9
+ # Node Version Manager [![Build Status](https://app.travis-ci.com/nvm-sh/nvm.svg?branch=master)][3] [![nvm version](https://img.shields.io/badge/version-v0.39.5-yellow.svg)][4] [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/684/badge)](https://bestpractices.coreinfrastructure.org/projects/684)
10
+
11
+ <!-- To update this table of contents, ensure you have run `npm install` then `npm run doctoc` -->
12
+ <!-- START doctoc generated TOC please keep comment here to allow auto update -->
13
+ <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
14
+ ## Table of Contents
15
+
16
+ - [Intro](#intro)
17
+ - [About](#about)
18
+ - [Installing and Updating](#installing-and-updating)
19
+ - [Install & Update Script](#install--update-script)
20
+ - [Additional Notes](#additional-notes)
21
+ - [Troubleshooting on Linux](#troubleshooting-on-linux)
22
+ - [Troubleshooting on macOS](#troubleshooting-on-macos)
23
+ - [Ansible](#ansible)
24
+ - [Verify Installation](#verify-installation)
25
+ - [Important Notes](#important-notes)
26
+ - [Git Install](#git-install)
27
+ - [Manual Install](#manual-install)
28
+ - [Manual Upgrade](#manual-upgrade)
29
+ - [Usage](#usage)
30
+ - [Long-term Support](#long-term-support)
31
+ - [Migrating Global Packages While Installing](#migrating-global-packages-while-installing)
32
+ - [Default Global Packages From File While Installing](#default-global-packages-from-file-while-installing)
33
+ - [io.js](#iojs)
34
+ - [System Version of Node](#system-version-of-node)
35
+ - [Listing Versions](#listing-versions)
36
+ - [Setting Custom Colors](#setting-custom-colors)
37
+ - [Persisting custom colors](#persisting-custom-colors)
38
+ - [Suppressing colorized output](#suppressing-colorized-output)
39
+ - [Restoring PATH](#restoring-path)
40
+ - [Set default node version](#set-default-node-version)
41
+ - [Use a mirror of node binaries](#use-a-mirror-of-node-binaries)
42
+ - [.nvmrc](#nvmrc)
43
+ - [Deeper Shell Integration](#deeper-shell-integration)
44
+ - [bash](#bash)
45
+ - [Automatically call `nvm use`](#automatically-call-nvm-use)
46
+ - [zsh](#zsh)
47
+ - [Calling `nvm use` automatically in a directory with a `.nvmrc` file](#calling-nvm-use-automatically-in-a-directory-with-a-nvmrc-file)
48
+ - [fish](#fish)
49
+ - [Calling `nvm use` automatically in a directory with a `.nvmrc` file](#calling-nvm-use-automatically-in-a-directory-with-a-nvmrc-file-1)
50
+ - [Running Tests](#running-tests)
51
+ - [Environment variables](#environment-variables)
52
+ - [Bash Completion](#bash-completion)
53
+ - [Usage](#usage-1)
54
+ - [Compatibility Issues](#compatibility-issues)
55
+ - [Installing nvm on Alpine Linux](#installing-nvm-on-alpine-linux)
56
+ - [Alpine Linux 3.13+](#alpine-linux-313)
57
+ - [Alpine Linux 3.5 - 3.12](#alpine-linux-35---312)
58
+ - [Uninstalling / Removal](#uninstalling--removal)
59
+ - [Manual Uninstall](#manual-uninstall)
60
+ - [Docker For Development Environment](#docker-for-development-environment)
61
+ - [Problems](#problems)
62
+ - [macOS Troubleshooting](#macos-troubleshooting)
63
+ - [WSL Troubleshooting](#wsl-troubleshooting)
64
+ - [Maintainers](#maintainers)
65
+ - [License](#license)
66
+ - [Copyright notice](#copyright-notice)
67
+
68
+ <!-- END doctoc generated TOC please keep comment here to allow auto update -->
69
+
70
+ ## Intro
71
+
72
+ `nvm` allows you to quickly install and use different versions of node via the command line.
73
+
74
+ **Example:**
75
+ ```sh
76
+ $ nvm use 16
77
+ Now using node v16.9.1 (npm v7.21.1)
78
+ $ node -v
79
+ v16.9.1
80
+ $ nvm use 14
81
+ Now using node v14.18.0 (npm v6.14.15)
82
+ $ node -v
83
+ v14.18.0
84
+ $ nvm install 12
85
+ Now using node v12.22.6 (npm v6.14.5)
86
+ $ node -v
87
+ v12.22.6
88
+ ```
89
+
90
+ Simple as that!
91
+
92
+
93
+ ## About
94
+ 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).
95
+
96
+ <a id="installation-and-update"></a>
97
+ <a id="install-script"></a>
98
+ ## Installing and Updating
99
+
100
+ ### Install & Update Script
101
+
102
+ 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:
103
+ ```sh
104
+ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash
105
+ ```
106
+ ```sh
107
+ wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash
108
+ ```
109
+
110
+ 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`).
111
+
112
+ <a id="profile_snippet"></a>
113
+ ```sh
114
+ export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
115
+ [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
116
+ ```
117
+
118
+ #### Additional Notes
119
+
120
+ - If the environment variable `$XDG_CONFIG_HOME` is present, it will place the `nvm` files there.</sub>
121
+
122
+ - 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.
123
+
124
+ - You can customize the install source, directory, profile, and version using the `NVM_SOURCE`, `NVM_DIR`, `PROFILE`, and `NODE_VERSION` variables.
125
+ Eg: `curl ... | NVM_DIR="path/to/nvm"`. Ensure that the `NVM_DIR` does not contain a trailing slash.
126
+
127
+ - The installer can use `git`, `curl`, or `wget` to download `nvm`, whichever is available.
128
+
129
+ - You can instruct the installer to not edit your shell config (for example if you already get completions via a [zsh nvm plugin](https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/nvm)) by setting `PROFILE=/dev/null` before running the `install.sh` script. Here's an example one-line command to do that: `PROFILE=/dev/null bash -c 'curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash'`
130
+
131
+ #### Troubleshooting on Linux
132
+
133
+ 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.
134
+ Alternatively, you can run the following commands for the different shells on the command line:
135
+
136
+ *bash*: `source ~/.bashrc`
137
+
138
+ *zsh*: `source ~/.zshrc`
139
+
140
+ *ksh*: `. ~/.profile`
141
+
142
+ These should pick up the `nvm` command.
143
+
144
+ #### Troubleshooting on macOS
145
+
146
+ 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))
147
+
148
+ If you get `nvm: command not found` after running the install script, one of the following might be the reason:
149
+
150
+ - 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.
151
+
152
+ - 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.
153
+
154
+ - You have previously used `bash`, but you have `zsh` installed. You need to manually add [these lines](#manual-install) to `~/.zshrc` and run `. ~/.zshrc`.
155
+
156
+ - 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.
157
+
158
+ - 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.
159
+
160
+ If the above doesn't fix the problem, you may try the following:
161
+
162
+ - 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.
163
+
164
+ - 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`).
165
+
166
+ - For more information about this issue and possible workarounds, please [refer here](https://github.com/nvm-sh/nvm/issues/576)
167
+
168
+ **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.
169
+
170
+ #### Ansible
171
+
172
+ You can use a task:
173
+
174
+ ```yaml
175
+ - name: Install nvm
176
+ ansible.builtin.shell: >
177
+ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash
178
+ args:
179
+ creates: "{{ ansible_env.HOME }}/.nvm/nvm.sh"
180
+ ```
181
+
182
+ ### Verify Installation
183
+
184
+ To verify that nvm has been installed, do:
185
+
186
+ ```sh
187
+ command -v nvm
188
+ ```
189
+
190
+ 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.
191
+
192
+ **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.
193
+
194
+ ### Important Notes
195
+
196
+ 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.
197
+
198
+ **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:
199
+
200
+ - [nvm-windows](https://github.com/coreybutler/nvm-windows)
201
+ - [nodist](https://github.com/marcelklehr/nodist)
202
+ - [nvs](https://github.com/jasongin/nvs)
203
+
204
+ **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:
205
+
206
+ - [bass](https://github.com/edc/bass) allows you to use utilities written for Bash in fish shell
207
+ - [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
208
+ - [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
209
+ - [fnm](https://github.com/fisherman/fnm) - [fisherman](https://github.com/fisherman/fisherman)-based version manager for fish
210
+ - [fish-nvm](https://github.com/FabioAntunes/fish-nvm) - Wrapper around nvm for fish, delays sourcing nvm until it's actually used.
211
+
212
+ **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:
213
+
214
+ - [[#900] [Bug] nodejs on FreeBSD may need to be patched](https://github.com/nvm-sh/nvm/issues/900)
215
+ - [nodejs/node#3716](https://github.com/nodejs/node/issues/3716)
216
+
217
+ **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:
218
+
219
+ - [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/)
220
+
221
+ **Note:** On OS X, if you have/had a "system" node installed and want to install modules globally, keep in mind that:
222
+
223
+ - 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`
224
+ - If you have an `~/.npmrc` file, make sure it does not contain any `prefix` settings (which is not compatible with `nvm`)
225
+ - 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/*`
226
+
227
+ 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.
228
+
229
+ **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.
230
+
231
+ **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.
232
+
233
+ ### Git Install
234
+
235
+ If you have `git` installed (requires git v1.7.10+):
236
+
237
+ 1. clone this repo in the root of your user profile
238
+ - `cd ~/` from anywhere then `git clone https://github.com/nvm-sh/nvm.git .nvm`
239
+ 1. `cd ~/.nvm` and check out the latest version with `git checkout v0.39.5`
240
+ 1. activate `nvm` by sourcing it from your shell: `. ./nvm.sh`
241
+
242
+ Now add these lines to your `~/.bashrc`, `~/.profile`, or `~/.zshrc` file to have it automatically sourced upon login:
243
+ (you may have to add to more than one of the above files)
244
+
245
+ ```sh
246
+ export NVM_DIR="$HOME/.nvm"
247
+ [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
248
+ [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
249
+ ```
250
+
251
+ ### Manual Install
252
+
253
+ For a fully manual install, execute the following lines to first clone the `nvm` repository into `$HOME/.nvm`, and then load `nvm`:
254
+
255
+ ```sh
256
+ export NVM_DIR="$HOME/.nvm" && (
257
+ git clone https://github.com/nvm-sh/nvm.git "$NVM_DIR"
258
+ cd "$NVM_DIR"
259
+ git checkout `git describe --abbrev=0 --tags --match "v[0-9]*" $(git rev-list --tags --max-count=1)`
260
+ ) && \. "$NVM_DIR/nvm.sh"
261
+ ```
262
+
263
+ Now add these lines to your `~/.bashrc`, `~/.profile`, or `~/.zshrc` file to have it automatically sourced upon login:
264
+ (you may have to add to more than one of the above files)
265
+
266
+ ```sh
267
+ export NVM_DIR="$HOME/.nvm"
268
+ [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
269
+ [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
270
+ ```
271
+
272
+ ### Manual Upgrade
273
+
274
+ For manual upgrade with `git` (requires git v1.7.10+):
275
+
276
+ 1. change to the `$NVM_DIR`
277
+ 1. pull down the latest changes
278
+ 1. check out the latest version
279
+ 1. activate the new version
280
+
281
+ ```sh
282
+ (
283
+ cd "$NVM_DIR"
284
+ git fetch --tags origin
285
+ git checkout `git describe --abbrev=0 --tags --match "v[0-9]*" $(git rev-list --tags --max-count=1)`
286
+ ) && \. "$NVM_DIR/nvm.sh"
287
+ ```
288
+
289
+ ## Usage
290
+
291
+ To download, compile, and install the latest release of node, do this:
292
+
293
+ ```sh
294
+ nvm install node # "node" is an alias for the latest version
295
+ ```
296
+
297
+ To install a specific version of node:
298
+
299
+ ```sh
300
+ nvm install 14.7.0 # or 16.3.0, 12.22.1, etc
301
+ ```
302
+
303
+ The first version installed becomes the default. New shells will start with the default version of node (e.g., `nvm alias default`).
304
+
305
+ You can list available versions using `ls-remote`:
306
+
307
+ ```sh
308
+ nvm ls-remote
309
+ ```
310
+
311
+ And then in any new shell just use the installed version:
312
+
313
+ ```sh
314
+ nvm use node
315
+ ```
316
+
317
+ Or you can just run it:
318
+
319
+ ```sh
320
+ nvm run node --version
321
+ ```
322
+
323
+ Or, you can run any arbitrary command in a subshell with the desired version of node:
324
+
325
+ ```sh
326
+ nvm exec 4.2 node --version
327
+ ```
328
+
329
+ You can also get the path to the executable to where it was installed:
330
+
331
+ ```sh
332
+ nvm which 12.22
333
+ ```
334
+
335
+ 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:
336
+
337
+ - `node`: this installs the latest version of [`node`](https://nodejs.org/en/)
338
+ - `iojs`: this installs the latest version of [`io.js`](https://iojs.org/en/)
339
+ - `stable`: this alias is deprecated, and only truly applies to `node` `v0.12` and earlier. Currently, this is an alias for `node`.
340
+ - `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).
341
+
342
+ ### Long-term Support
343
+
344
+ 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:
345
+
346
+ - `nvm install --lts` / `nvm install --lts=argon` / `nvm install 'lts/*'` / `nvm install lts/argon`
347
+ - `nvm uninstall --lts` / `nvm uninstall --lts=argon` / `nvm uninstall 'lts/*'` / `nvm uninstall lts/argon`
348
+ - `nvm use --lts` / `nvm use --lts=argon` / `nvm use 'lts/*'` / `nvm use lts/argon`
349
+ - `nvm exec --lts` / `nvm exec --lts=argon` / `nvm exec 'lts/*'` / `nvm exec lts/argon`
350
+ - `nvm run --lts` / `nvm run --lts=argon` / `nvm run 'lts/*'` / `nvm run lts/argon`
351
+ - `nvm ls-remote --lts` / `nvm ls-remote --lts=argon` `nvm ls-remote 'lts/*'` / `nvm ls-remote lts/argon`
352
+ - `nvm version-remote --lts` / `nvm version-remote --lts=argon` / `nvm version-remote 'lts/*'` / `nvm version-remote lts/argon`
353
+
354
+ 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.
355
+
356
+ To get the latest LTS version of node and migrate your existing installed packages, use
357
+
358
+ ```sh
359
+ nvm install 'lts/*' --reinstall-packages-from=current
360
+ ```
361
+
362
+ ### Migrating Global Packages While Installing
363
+
364
+ If you want to install a new version of Node.js and migrate npm packages from a previous version:
365
+
366
+ ```sh
367
+ nvm install node --reinstall-packages-from=node
368
+ ```
369
+
370
+ This will first use "nvm version node" to identify the current version you're migrating packages from. Then it resolves the new version to install from the remote server and installs it. Lastly, it runs "nvm reinstall-packages" to reinstall the npm packages from your prior version of Node to the new one.
371
+
372
+ You can also install and migrate npm packages from specific versions of Node like this:
373
+
374
+ ```sh
375
+ nvm install 6 --reinstall-packages-from=5
376
+ nvm install v4.2 --reinstall-packages-from=iojs
377
+ ```
378
+
379
+ 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.
380
+
381
+ To update npm at the same time add the `--latest-npm` flag, like this:
382
+
383
+ ```sh
384
+ nvm install 'lts/*' --reinstall-packages-from=default --latest-npm
385
+ ```
386
+
387
+ or, you can at any time run the following command to get the latest supported npm version on the current node version:
388
+ ```sh
389
+ nvm install-latest-npm
390
+ ```
391
+
392
+ 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.
393
+
394
+
395
+ ### Default Global Packages From File While Installing
396
+
397
+ 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.
398
+
399
+ ```sh
400
+ # $NVM_DIR/default-packages
401
+
402
+ rimraf
403
+ object-inspect@1.0.2
404
+ stevemao/left-pad
405
+ ```
406
+
407
+ ### io.js
408
+
409
+ If you want to install [io.js](https://github.com/iojs/io.js/):
410
+
411
+ ```sh
412
+ nvm install iojs
413
+ ```
414
+
415
+ If you want to install a new version of io.js and migrate npm packages from a previous version:
416
+
417
+ ```sh
418
+ nvm install iojs --reinstall-packages-from=iojs
419
+ ```
420
+
421
+ The same guidelines mentioned for migrating npm packages in node are applicable to io.js.
422
+
423
+ ### System Version of Node
424
+
425
+ If you want to use the system-installed version of node, you can use the special default alias "system":
426
+
427
+ ```sh
428
+ nvm use system
429
+ nvm run system --version
430
+ ```
431
+
432
+ ### Listing Versions
433
+
434
+ If you want to see what versions are installed:
435
+
436
+ ```sh
437
+ nvm ls
438
+ ```
439
+
440
+ If you want to see what versions are available to install:
441
+
442
+ ```sh
443
+ nvm ls-remote
444
+ ```
445
+
446
+ ### Setting Custom Colors
447
+
448
+ You can set five colors that will be used to display version and alias information. These colors replace the default colors.
449
+ Initial colors are: g b y r e
450
+
451
+ Color codes:
452
+
453
+ r/R = red / bold red
454
+
455
+ g/G = green / bold green
456
+
457
+ b/B = blue / bold blue
458
+
459
+ c/C = cyan / bold cyan
460
+
461
+ m/M = magenta / bold magenta
462
+
463
+ y/Y = yellow / bold yellow
464
+
465
+ k/K = black / bold black
466
+
467
+ e/W = light grey / white
468
+
469
+ ```sh
470
+ nvm set-colors rgBcm
471
+ ```
472
+
473
+ #### Persisting custom colors
474
+
475
+ 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:
476
+
477
+ ```sh
478
+ export NVM_COLORS='cmgRY'
479
+ ```
480
+
481
+ #### Suppressing colorized output
482
+
483
+ `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`):
484
+
485
+ ```sh
486
+ nvm ls --no-colors
487
+ nvm help --no-colors
488
+ TERM=dumb nvm ls
489
+ ```
490
+
491
+ #### Restoring PATH
492
+ To restore your PATH, you can deactivate it:
493
+
494
+ ```sh
495
+ nvm deactivate
496
+ ```
497
+
498
+ #### Set default node version
499
+ To set a default Node version to be used in any new shell, use the alias 'default':
500
+
501
+ ```sh
502
+ nvm alias default node # this refers to the latest installed version of node
503
+ nvm alias default 18 # this refers to the latest installed v18.x version of node
504
+ nvm alias default 18.12 # this refers to the latest installed v18.12.x version of node
505
+ ```
506
+
507
+ #### Use a mirror of node binaries
508
+ To use a mirror of the node binaries, set `$NVM_NODEJS_ORG_MIRROR`:
509
+
510
+ ```sh
511
+ export NVM_NODEJS_ORG_MIRROR=https://nodejs.org/dist
512
+ nvm install node
513
+
514
+ NVM_NODEJS_ORG_MIRROR=https://nodejs.org/dist nvm install 4.2
515
+ ```
516
+
517
+ To use a mirror of the io.js binaries, set `$NVM_IOJS_ORG_MIRROR`:
518
+
519
+ ```sh
520
+ export NVM_IOJS_ORG_MIRROR=https://iojs.org/dist
521
+ nvm install iojs-v1.0.3
522
+
523
+ NVM_IOJS_ORG_MIRROR=https://iojs.org/dist nvm install iojs-v1.0.3
524
+ ```
525
+
526
+ `nvm use` will not, by default, create a "current" symlink. Set `$NVM_SYMLINK_CURRENT` to "true" to enable this behavior, which is sometimes useful for IDEs. Note that using `nvm` in multiple shell tabs with this environment variable enabled can cause race conditions.
527
+
528
+ ### .nvmrc
529
+
530
+ You can create a `.nvmrc` file containing a node version number (or any other string that `nvm` understands; see `nvm --help` for details) in the project root directory (or any parent directory).
531
+ Afterwards, `nvm use`, `nvm install`, `nvm exec`, `nvm run`, and `nvm which` will use the version specified in the `.nvmrc` file if no version is supplied on the command line.
532
+
533
+ For example, to make nvm default to the latest 5.9 release, the latest LTS version, or the latest node version for the current directory:
534
+
535
+ ```sh
536
+ $ echo "5.9" > .nvmrc
537
+
538
+ $ echo "lts/*" > .nvmrc # to default to the latest LTS version
539
+
540
+ $ echo "node" > .nvmrc # to default to the latest version
541
+ ```
542
+
543
+ [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.]
544
+
545
+ Then when you run nvm:
546
+
547
+ ```sh
548
+ $ nvm use
549
+ Found '/path/to/project/.nvmrc' with version <5.9>
550
+ Now using node v5.9.1 (npm v3.7.3)
551
+ ```
552
+
553
+ `nvm use` et. al. will traverse directory structure upwards from the current directory looking for the `.nvmrc` file. In other words, running `nvm use` et. al. in any subdirectory of a directory with an `.nvmrc` will result in that `.nvmrc` being utilized.
554
+
555
+ The contents of a `.nvmrc` file **must** be the `<version>` (as described by `nvm --help`) followed by a newline. No trailing spaces are allowed, and the trailing newline is required.
556
+
557
+ ### Deeper Shell Integration
558
+
559
+ 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).
560
+
561
+ You can also use [`nvshim`](https://github.com/iamogbz/nvshim) to shim the `node`, `npm`, and `npx` bins to automatically use the `nvm` config in the current directory. `nvshim` is **not** supported by the `nvm` maintainers. Please [report issues to the `nvshim` team](https://github.com/iamogbz/nvshim/issues/new).
562
+
563
+ 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.
564
+
565
+ #### bash
566
+
567
+ ##### Automatically call `nvm use`
568
+
569
+ Put the following at the end of your `$HOME/.bashrc`:
570
+
571
+ ```bash
572
+ cdnvm() {
573
+ command cd "$@" || return $?
574
+ nvm_path=$(nvm_find_up .nvmrc | tr -d '\n')
575
+
576
+ # If there are no .nvmrc file, use the default nvm version
577
+ if [[ ! $nvm_path = *[^[:space:]]* ]]; then
578
+
579
+ declare default_version;
580
+ default_version=$(nvm version default);
581
+
582
+ # If there is no default version, set it to `node`
583
+ # This will use the latest version on your machine
584
+ if [[ $default_version == "N/A" ]]; then
585
+ nvm alias default node;
586
+ default_version=$(nvm version default);
587
+ fi
588
+
589
+ # If the current version is not the default version, set it to use the default version
590
+ if [[ $(nvm current) != "$default_version" ]]; then
591
+ nvm use default;
592
+ fi
593
+
594
+ elif [[ -s $nvm_path/.nvmrc && -r $nvm_path/.nvmrc ]]; then
595
+ declare nvm_version
596
+ nvm_version=$(<"$nvm_path"/.nvmrc)
597
+
598
+ declare locally_resolved_nvm_version
599
+ # `nvm ls` will check all locally-available versions
600
+ # If there are multiple matching versions, take the latest one
601
+ # Remove the `->` and `*` characters and spaces
602
+ # `locally_resolved_nvm_version` will be `N/A` if no local versions are found
603
+ locally_resolved_nvm_version=$(nvm ls --no-colors "$nvm_version" | tail -1 | tr -d '\->*' | tr -d '[:space:]')
604
+
605
+ # If it is not already installed, install it
606
+ # `nvm install` will implicitly use the newly-installed version
607
+ if [[ "$locally_resolved_nvm_version" == "N/A" ]]; then
608
+ nvm install "$nvm_version";
609
+ elif [[ $(nvm current) != "$locally_resolved_nvm_version" ]]; then
610
+ nvm use "$nvm_version";
611
+ fi
612
+ fi
613
+ }
614
+
615
+ alias cd='cdnvm'
616
+ cdnvm "$PWD" || exit
617
+ ```
618
+
619
+ 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.
620
+
621
+ #### zsh
622
+
623
+ ##### Calling `nvm use` automatically in a directory with a `.nvmrc` file
624
+
625
+ Put this into your `$HOME/.zshrc` to call `nvm use` automatically whenever you enter a directory that contains an
626
+ `.nvmrc` file with a string telling nvm which node to `use`:
627
+
628
+ ```zsh
629
+ # place this after nvm initialization!
630
+ autoload -U add-zsh-hook
631
+
632
+ load-nvmrc() {
633
+ local nvmrc_path
634
+ nvmrc_path="$(nvm_find_nvmrc)"
635
+
636
+ if [ -n "$nvmrc_path" ]; then
637
+ local nvmrc_node_version
638
+ nvmrc_node_version=$(nvm version "$(cat "${nvmrc_path}")")
639
+
640
+ if [ "$nvmrc_node_version" = "N/A" ]; then
641
+ nvm install
642
+ elif [ "$nvmrc_node_version" != "$(nvm version)" ]; then
643
+ nvm use
644
+ fi
645
+ elif [ -n "$(PWD=$OLDPWD nvm_find_nvmrc)" ] && [ "$(nvm version)" != "$(nvm version default)" ]; then
646
+ echo "Reverting to nvm default version"
647
+ nvm use default
648
+ fi
649
+ }
650
+
651
+ add-zsh-hook chpwd load-nvmrc
652
+ load-nvmrc
653
+ ```
654
+
655
+ #### fish
656
+
657
+ ##### Calling `nvm use` automatically in a directory with a `.nvmrc` file
658
+ This requires that you have [bass](https://github.com/edc/bass) installed.
659
+ ```fish
660
+ # ~/.config/fish/functions/nvm.fish
661
+ function nvm
662
+ bass source ~/.nvm/nvm.sh --no-use ';' nvm $argv
663
+ end
664
+
665
+ # ~/.config/fish/functions/nvm_find_nvmrc.fish
666
+ function nvm_find_nvmrc
667
+ bass source ~/.nvm/nvm.sh --no-use ';' nvm_find_nvmrc
668
+ end
669
+
670
+ # ~/.config/fish/functions/load_nvm.fish
671
+ function load_nvm --on-variable="PWD"
672
+ set -l default_node_version (nvm version default)
673
+ set -l node_version (nvm version)
674
+ set -l nvmrc_path (nvm_find_nvmrc)
675
+ if test -n "$nvmrc_path"
676
+ set -l nvmrc_node_version (nvm version (cat $nvmrc_path))
677
+ if test "$nvmrc_node_version" = "N/A"
678
+ nvm install (cat $nvmrc_path)
679
+ else if test "$nvmrc_node_version" != "$node_version"
680
+ nvm use $nvmrc_node_version
681
+ end
682
+ else if test "$node_version" != "$default_node_version"
683
+ echo "Reverting to default Node version"
684
+ nvm use default
685
+ end
686
+ end
687
+
688
+ # ~/.config/fish/config.fish
689
+ # You must call it on initialization or listening to directory switching won't work
690
+ load_nvm > /dev/stderr
691
+ ```
692
+
693
+ ## Running Tests
694
+
695
+ Tests are written in [Urchin]. Install Urchin (and other dependencies) like so:
696
+
697
+ npm install
698
+
699
+ There are slow tests and fast tests. The slow tests do things like install node
700
+ and check that the right versions are used. The fast tests fake this to test
701
+ things like aliases and uninstalling. From the root of the nvm git repository,
702
+ run the fast tests like this:
703
+
704
+ npm run test/fast
705
+
706
+ Run the slow tests like this:
707
+
708
+ npm run test/slow
709
+
710
+ Run all of the tests like this:
711
+
712
+ npm test
713
+
714
+ Nota bene: Avoid running nvm while the tests are running.
715
+
716
+ ## Environment variables
717
+
718
+ nvm exposes the following environment variables:
719
+
720
+ - `NVM_DIR` - nvm's installation directory.
721
+ - `NVM_BIN` - where node, npm, and global packages for the active version of node are installed.
722
+ - `NVM_INC` - node's include file directory (useful for building C/C++ addons for node).
723
+ - `NVM_CD_FLAGS` - used to maintain compatibility with zsh.
724
+ - `NVM_RC_VERSION` - version from .nvmrc file if being used.
725
+
726
+ Additionally, nvm modifies `PATH`, and, if present, `MANPATH` and `NODE_PATH` when changing versions.
727
+
728
+
729
+ ## Bash Completion
730
+
731
+ To activate, you need to source `bash_completion`:
732
+
733
+ ```sh
734
+ [[ -r $NVM_DIR/bash_completion ]] && \. $NVM_DIR/bash_completion
735
+ ```
736
+
737
+ Put the above sourcing line just below the sourcing line for nvm in your profile (`.bashrc`, `.bash_profile`).
738
+
739
+ ### Usage
740
+
741
+ nvm:
742
+
743
+ > `$ nvm` <kbd>Tab</kbd>
744
+ ```sh
745
+ alias deactivate install list-remote reinstall-packages uninstall version
746
+ cache exec install-latest-npm ls run unload version-remote
747
+ current help list ls-remote unalias use which
748
+ ```
749
+
750
+ nvm alias:
751
+
752
+ > `$ nvm alias` <kbd>Tab</kbd>
753
+ ```sh
754
+ default iojs lts/* lts/argon lts/boron lts/carbon lts/dubnium lts/erbium node stable unstable
755
+ ```
756
+
757
+
758
+ > `$ nvm alias my_alias` <kbd>Tab</kbd>
759
+ ```sh
760
+ v10.22.0 v12.18.3 v14.8.0
761
+ ```
762
+
763
+ nvm use:
764
+ > `$ nvm use` <kbd>Tab</kbd>
765
+
766
+ ```
767
+ my_alias default v10.22.0 v12.18.3 v14.8.0
768
+ ```
769
+
770
+ nvm uninstall:
771
+ > `$ nvm uninstall` <kbd>Tab</kbd>
772
+
773
+ ```
774
+ my_alias default v10.22.0 v12.18.3 v14.8.0
775
+ ```
776
+
777
+ ## Compatibility Issues
778
+
779
+ `nvm` will encounter some issues if you have some non-default settings set. (see [#606](https://github.com/creationix/nvm/issues/606))
780
+ The following are known to cause issues:
781
+
782
+ Inside `~/.npmrc`:
783
+
784
+ ```sh
785
+ prefix='some/path'
786
+ ```
787
+
788
+ Environment Variables:
789
+
790
+ ```sh
791
+ $NPM_CONFIG_PREFIX
792
+ $PREFIX
793
+ ```
794
+
795
+ Shell settings:
796
+
797
+ ```sh
798
+ set -e
799
+ ```
800
+
801
+ ## Installing nvm on Alpine Linux
802
+
803
+ 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).
804
+
805
+ 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.
806
+
807
+ There is a `-s` flag for `nvm install` which requests nvm download Node source and compile it locally.
808
+
809
+ 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:
810
+
811
+ ### Alpine Linux 3.13+
812
+ ```sh
813
+ apk add -U curl bash ca-certificates openssl ncurses coreutils python3 make gcc g++ libgcc linux-headers grep util-linux binutils findutils
814
+ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash
815
+ ```
816
+
817
+ ### Alpine Linux 3.5 - 3.12
818
+ ```sh
819
+ apk add -U curl bash ca-certificates openssl ncurses coreutils python2 make gcc g++ libgcc linux-headers grep util-linux binutils findutils
820
+ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash
821
+ ```
822
+
823
+ _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._
824
+
825
+ The Node project has some desire but no concrete plans (due to the overheads of building, testing and support) to offer Alpine-compatible binaries.
826
+
827
+ 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).
828
+
829
+ <a id="removal"></a>
830
+ ## Uninstalling / Removal
831
+
832
+ ### Manual Uninstall
833
+
834
+ To remove `nvm` manually, execute the following:
835
+
836
+ ```sh
837
+ $ rm -rf "$NVM_DIR"
838
+ ```
839
+
840
+ Edit `~/.bashrc` (or other shell resource config) and remove the lines below:
841
+
842
+ ```sh
843
+ export NVM_DIR="$HOME/.nvm"
844
+ [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
845
+ [[ -r $NVM_DIR/bash_completion ]] && \. $NVM_DIR/bash_completion
846
+ ```
847
+
848
+ ## Docker For Development Environment
849
+
850
+ 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:
851
+
852
+ ```sh
853
+ $ docker build -t nvm-dev .
854
+ ```
855
+
856
+ This will package your current nvm repository with our pre-defined development environment into a docker image named `nvm-dev`, once it's built with success, validate your image via `docker images`:
857
+
858
+ ```sh
859
+ $ docker images
860
+
861
+ REPOSITORY TAG IMAGE ID CREATED SIZE
862
+ nvm-dev latest 9ca4c57a97d8 7 days ago 650 MB
863
+ ```
864
+
865
+ If you got no error message, now you can easily involve in:
866
+
867
+ ```sh
868
+ $ docker run -h nvm-dev -it nvm-dev
869
+
870
+ nvm@nvm-dev:~/.nvm$
871
+ ```
872
+
873
+ 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.
874
+
875
+ For more information and documentation about docker, please refer to its official website:
876
+
877
+ - https://www.docker.com/
878
+ - https://docs.docker.com/
879
+
880
+ ## Problems
881
+
882
+ - 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:
883
+
884
+ curl: (33) HTTP server doesn't seem to support byte ranges. Cannot resume.
885
+
886
+ - Where's my `sudo node`? Check out [#43](https://github.com/nvm-sh/nvm/issues/43)
887
+
888
+ - 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:
889
+
890
+ ```sh
891
+ nvm install -s 0.8.6
892
+ ```
893
+
894
+ - 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))
895
+
896
+ ## macOS Troubleshooting
897
+
898
+ **nvm node version not found in vim shell**
899
+
900
+ If you set node version to a version other than your system node version `nvm use 6.2.1` and open vim and run `:!node -v` you should see `v6.2.1` if you see your system version `v0.12.7`. You need to run:
901
+
902
+ ```shell
903
+ sudo chmod ugo-x /usr/libexec/path_helper
904
+ ```
905
+
906
+ More on this issue in [dotphiles/dotzsh](https://github.com/dotphiles/dotzsh#mac-os-x).
907
+
908
+ **nvm is not compatible with the npm config "prefix" option**
909
+
910
+ Some solutions for this issue can be found [here](https://github.com/nvm-sh/nvm/issues/1245)
911
+
912
+ 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**.
913
+
914
+ 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)).
915
+
916
+ To change the user directory and/or account name follow the instructions [here](https://support.apple.com/en-us/HT201548)
917
+
918
+ [1]: https://github.com/nvm-sh/nvm.git
919
+ [2]: https://github.com/nvm-sh/nvm/blob/v0.39.5/install.sh
920
+ [3]: https://app.travis-ci.com/nvm-sh/nvm
921
+ [4]: https://github.com/nvm-sh/nvm/releases/tag/v0.39.5
922
+ [Urchin]: https://git.sdf.org/tlevine/urchin
923
+ [Fish]: https://fishshell.com
924
+
925
+ **Homebrew makes zsh directories unsecure**
926
+
927
+ ```shell
928
+ zsh compinit: insecure directories, run compaudit for list.
929
+ Ignore insecure directories and continue [y] or abort compinit [n]? y
930
+ ```
931
+
932
+ 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.
933
+
934
+ **Macs with M1 chip**
935
+
936
+ Experimental support for the M1 architecture was added in node.js v15.3 and full support was added in v16.0.
937
+ 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.
938
+
939
+ 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.
940
+ Here's what you will need to do:
941
+
942
+ - Install Rosetta, if you haven't already done so
943
+
944
+ ```sh
945
+ $ softwareupdate --install-rosetta
946
+ ```
947
+
948
+ You might wonder, "how will my M1 Mac know to use Rosetta for a version of node compiled for an Intel chip?".
949
+ If an executable contains only Intel instructions, macOS will automatically use Rosetta to translate the instructions.
950
+
951
+ - Open a shell that's running using Rosetta
952
+
953
+ ```sh
954
+ $ arch -x86_64 zsh
955
+ ```
956
+
957
+ 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".
958
+
959
+ Note: This terminal session is now running in `zsh`.
960
+ 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.
961
+ If that's the case, make sure to source `nvm`.
962
+
963
+ ```sh
964
+ $ source "${NVM_DIR}/nvm.sh"
965
+ ```
966
+
967
+ - Install whatever older version of node you are interested in. Let's use 12.22.1 as an example.
968
+ This will fetch the node source code and compile it, which will take several minutes.
969
+
970
+ ```sh
971
+ $ nvm install v12.22.1 --shared-zlib
972
+ ```
973
+
974
+ Note: You're probably curious why `--shared-zlib` is included.
975
+ There's a bug in recent versions of Apple's system `clang` compiler.
976
+ 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.
977
+ However, later, when you attempt to `npm install` something using your old version of node.js, you will see `incorrect data check` errors.
978
+ If you want to avoid the possible hassle of dealing with this, include that flag.
979
+ 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)
980
+
981
+ - Exit back to your native shell.
982
+
983
+ ```sh
984
+ $ exit
985
+ $ arch
986
+ arm64
987
+ ```
988
+
989
+ 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.
990
+ Unless you have another reason to have that box selected, you can deselect it now.
991
+
992
+ - Check to make sure the architecture is correct. `x64` is the abbreviation for `x86_64`, which is what you want to see.
993
+
994
+ ```sh
995
+ $ node -p process.arch
996
+ x64
997
+ ```
998
+
999
+ Now you should be able to use node as usual.
1000
+
1001
+ ## WSL Troubleshooting
1002
+
1003
+ If you've encountered this error on WSL-2:
1004
+
1005
+ ```sh
1006
+ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash
1007
+ % Total % Received % Xferd Average Speed Time Time Time Current
1008
+ Dload Upload Total Spent Left Speed
1009
+ 0 0 0 0 0 0 0 0 --:--:-- 0:00:09 --:--:-- 0curl: (6) Could not resolve host: raw.githubusercontent.com
1010
+ ```
1011
+
1012
+ It may be due to your antivirus, VPN, or other reasons.
1013
+
1014
+ Where you can `ping 8.8.8.8` while you can't `ping google.com`
1015
+
1016
+
1017
+ This could simply be solved by running this in your root directory:
1018
+
1019
+ ```sh
1020
+ sudo rm /etc/resolv.conf
1021
+ sudo bash -c 'echo "nameserver 8.8.8.8" > /etc/resolv.conf'
1022
+ sudo bash -c 'echo "[network]" > /etc/wsl.conf'
1023
+ sudo bash -c 'echo "generateResolvConf = false" >> /etc/wsl.conf'
1024
+ sudo chattr +i /etc/resolv.conf
1025
+ ```
1026
+
1027
+ This deletes your `resolv.conf` file thats automatically generated when u run WSL, creates a new file and puts `nameserver 8.8.8.8`, then creates a `wsl.conf` file and adds `[network]` and `generateResolveConf = false` to prevent auto generation of that file.
1028
+
1029
+ You can check the contents of the file by running:
1030
+
1031
+ ```sh
1032
+ cat /etc/resolv.conf
1033
+ ```
1034
+
1035
+ ## Maintainers
1036
+
1037
+ 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.
1038
+
1039
+ ## License
1040
+
1041
+ See [LICENSE.md](./LICENSE.md).
1042
+
1043
+ ## Copyright notice
1044
+
1045
+ 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.
1046
+
1047
+ [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/)