Compare commits

..

4 Commits

Author SHA1 Message Date
Jordan Harband
aa71b65b94 fixup 2019-10-29 12:52:05 -07:00
Jordan Harband
25365b3225 [readme] add OpenJSF logo 2019-10-29 12:33:13 -07:00
Jordan Harband
c0fe20f544 [meta] add OpenJSF CoC reference 2019-10-29 12:34:18 -07:00
Jordan Harband
7d67b26f76 [meta] add CODE_OF_CONDUCT.md 2019-10-29 11:46:36 -07:00
208 changed files with 2652 additions and 7413 deletions

View File

@@ -12,17 +12,11 @@ trim_trailing_whitespace = true
[*.txt]
indent_size = false
[test/fast/Listing versions/Running 'nvm ls' calls into nvm_alias]
[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]
[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]
indent_style = tab

2
.gitattributes vendored
View File

@@ -1 +1 @@
* text=auto eol=lf
* eol=lf

12
.github/FUNDING.yml vendored
View File

@@ -1,12 +0,0 @@
# 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']

27
.github/SECURITY.md vendored
View File

@@ -1,27 +0,0 @@
# Security
Please email [@ljharb](https://github.com/ljharb) or see https://tidelift.com/security if you have a potential security vulnerability to report.
## OpenSSF CII Best Practices
[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/684/badge)](https://bestpractices.coreinfrastructure.org/projects/684)
There are three “tiers”: passing, silver, and gold.
### Passing
We meet 100% of the “passing” criteria.
### Silver
We meet 95% of the “silver” criteria. The gaps are as follows:
- we do not have a DCO or a CLA process for contributions.
- because we only have one maintainer, the project has no way to continue if that maintainer stops being active.
- we do not currently document “what the user can and cannot expect in terms of security” for our project. This is planned to be completed in 2023.
### Gold
We meet 65% of the “gold” criteria. The gaps are as follows:
- we do not yet have the “silver” badge; see all the gaps above.
- We do not include a copyright or license statement in each source file. Efforts are underway to change this archaic practice into a suggestion instead of a hard requirement.
## Threat Model
See [THREAT_MODEL.md](./THREAT_MODEL.md).

View File

@@ -1,109 +0,0 @@
# `nvm` Threat Model
## Introduction
Threat model analysis assists organizations to proactively identify potential security threats and vulnerabilities, enabling them to develop effective strategies to mitigate these risks before they are exploited by attackers.
Furthermore, this often helps to improve the overall security and resilience of a system or application.
The aim of this section is to facilitate the identification of potential security threats and vulnerabilities that may be exploited by adversaries, along with possible outcomes and appropriate mitigations.
## Relevant assets and threat actors
The following assets are considered important for the `nvm` project:
- `nvm` source code and project documentation
- Underlying `nvm`` dependencies
- `nvm` development infrastructure
- `nvm` installed devices including servers
The following threat actors are considered relevant to the `nvm` application:
- External malicious attackers
- Internal malicious attackers
- Services
- Malicious insider actors
- Third-party libraries
## Attack surface for external/internal attackers and services
In threat modeling, an attack surface refers to any possible point of entry that an attacker might use to exploit a system or application.
This includes all the paths and interfaces that an attacker may use to access, manipulate or extract sensitive data from a system.
By understanding the attack surface, organizations are typically able to identify potential attack vectors and implement appropriate countermeasures to mitigate risks.
In the following diagrams, _External Malicious Attacker_ applies to threat actors who do not yet have direct access to the `nvm` application and the underlying operating system, while the _Internal Malicious Attacker_ applies to an attacker with access to the device (computer, server), potentially after successfully exploiting a threat from the _External Malicious Attacker_ scenario.
**Please note that some of the external threats may be also exploitable from internal threats and vice versa.**
<img src="./external-threat-actor.png" alt="Fig.: Possible attacks from internal and external threat actors and services" />
Fig.: Possible attacks from internal and external threat actors and services
## Identified threats
The identified threats against the `nvm` application are as follows:
### Threat ID 1: `nvm` commands
Overview: The `nvm` commands and subcommands take user input for handling and executing appropriate functions from the project directory (or any parent directory).
When user-controlled inputs are not adequately validated and later passed to the `nvm` functions as a part of a command, an attacker might be able to execute operating system commands triggered by any parsing functionality.
Possible Outcome: Attacks against `nvm` commands could lead to unauthorized access to user data or unauthorized access to the device (i.e. laptop or server, depending on where `nvm` is installed), resulting in loss of user private data stored on the device, among other possibilities.
Recommendation: Input validation should be implemented to prevent attackers from requesting operating system commands.
Similarly, secure coding practices ought to be in place to minimize the risk of buffer overflow vulnerabilities.
### Threat ID 2: URI scheme
Overview: `nvm` commands heavily use the [Secure HyperText Transfer](https://datatracker.ietf.org/doc/html/rfc2660) protocol for `nvm` related actions.
Missing [scheme](https://datatracker.ietf.org/doc/html/rfc3986#section-3.1) validation for any `nvm` command might result in file retrieval, enumeration, file overwrite, or [path traversal](https://owasp.org/www-project-web-security-testing-guide/latest/4-Web_Application_Security_Testing/05-Authorization_Testing/01-Testing_Directory_Traversal_File_Include) attacks.
An example of this could be path validation for [`nvm_download`](https://github.com/nvm-sh/nvm/blob/ef7fc2f2c06ad75fe7fbabf28d427561ae7b007d/nvm.sh#L118), among many other possibilities.
Possible Outcome: Security misconfiguration flaws for URI scheme may lead to unauthorized access to user data, as well as data integrity compromises.
Recommendation: Adequate input validation should be implemented to prevent attackers from enumerating, retrieving and writing to application files and paths.
### Threat ID 3: Communication channel
Overview: The `nvm` commands and its subcommands use network protocol to communicate with external services.
Insecure communication may allow malicious attackers to perform [_Man-in-the-Middle_](https://owasp.org/www-community/attacks/Manipulator-in-the-middle_attack) attacks in order to manipulate the data sent during the users active connection.
Possible Outcome: Usage of plaintext communication protocols, like HTTP could lead to data sniffing and modification through insecure communications channels.
Recommendation: Mitigation countermeasures such as data encryption should be in place to prevent data manipulation via insecure communication channels.
### Threat ID 4: Environment variables
Overview: Each `nvm` installation defines its environment variables, which should be secured from internal malicious attackers, preventing access control attack vectors.
Missing stringent restrictions on setting variables, might allow attackers to prepare various targeted attacks against other local users, who use `nvm` in their user space.
For example, [_Privilege Escalation_](https://owasp.org/Top10/A01_2021-Broken_Access_Control/), [_Command Injection_](https://cwe.mitre.org/data/definitions/77.html), as well as many other parser-related attacks.
Possible Outcome: Attacks against environment variables could lead to unauthorized access to the user space, resulting in the loss of user private data and disruptions in service availability.
Recommendation: Adequate hardening of configuration file permissions should be in place for all relevant configuration files, as this provides protection against attackers able to manipulate variables and inject malicious code.
## Attack surface for malicious insider actors and third-party libraries
The following diagram summarizes the main possible threats against the `nvm` project from malicious insider actors and third-party libraries:
<img src="./insider-threat-actor-and-libs.png" alt="Fig.: Possible attacks from insider threat actors and third-party libraries" />
Fig.: Possible attacks from insider threat actors and third-party libraries
The identified threats against the `nvm` project are as follows:
### Threat ID 1: Insider threat actor
**Overview**: An insider threat actor, such as an `nvm` project contributor or employee with access to the code base, might abuse their role in the organization to modify the `nvm` application source code.
For example, intentionally adding malicious code snippets, clearing logs after being written and/or modifying specific sections of the documentation.
**Possible Outcome**: Reputation damage, financial losses.
**Recommendation**: Secure coding practices, code reviews, automated code scanning and separation of duties (i.e. requiring at least two developers to approve any code change) are potentially useful security controls to identify and mitigate vulnerabilities that may be introduced by an insider threat actor.
### Threat ID 2: Third-party libraries
**Overview**: Please note that while `nvm` does not currently make use of any third-party libraries, this might become an attack vector if that changes in the future.
Third-party libraries may introduce potential risks related to maintaining security requirements by third-party vendors.
As a result, third-party libraries used by the `nvm` project, might contain vulnerabilities, such as [_Buffer Overflows_](https://owasp.org/www-community/vulnerabilities/Buffer_Overflow), [_Format String Vulnerabilities_](https://owasp.org/www-community/attacks/Format_string_attack), as well as many other types of weaknesses that, in a worst-case scenario may lead to _Remote Code Execution_ (_RCE_).
Additionally, the maintainer of a third-party dependency might introduce a vulnerability on purpose, or be compromised by an attacker that subsequently introduces vulnerable code.
**Possible Outcome**: Code vulnerabilities may lead to unauthorized access to user data, loss of user private data, service disruptions and reputation damage.
**Recommendation**: Third-party libraries should be kept up-to-date, applying patches to address publicly known vulnerabilities in a timely fashion.
Monitoring and logging capabilities should also be in place to detect and respond to potential attacks.
SLSA compliance may also be considered for further supply chain security hardening.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 134 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 55 KiB

View File

@@ -1,81 +0,0 @@
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
raw.githubusercontent.com:443
iojs.org:443
nodejs.org:443
registry.npmjs.org:443
- uses: actions/checkout@v3
- uses: ljharb/actions/node/install@main
name: 'install node'
with:
node-version: ${{ matrix.node-version }}
skip-ls-check: true
skip-install: true
skip-latest-npm: true
- run: npm --version
- run: '. ./nvm.sh ; nvm install-latest-npm'
name: 'nvm install-latest-npm'
- 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'

View File

@@ -1,77 +0,0 @@
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
raw.githubusercontent.com:443
nodejs.org:443
registry.npmjs.org:443
- uses: actions/checkout@v3
- 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
raw.githubusercontent.com:443
pkg-containers.githubusercontent.com:443
nodejs.org:443
registry.npmjs.org:443
- uses: actions/checkout@v3
- 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
raw.githubusercontent.com:443
nodejs.org:443
registry.npmjs.org:443
- uses: actions/checkout@v3
- 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
raw.githubusercontent.com:443
- uses: actions/checkout@v3
- name: check tests filenames
run: ./rename_test.sh --check

View File

@@ -1,23 +0,0 @@
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@v3
- uses: ljharb/rebase@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -1,32 +0,0 @@
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@v3
- uses: actions/setup-node@v3
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

@@ -1,21 +0,0 @@
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 }}

View File

@@ -1,58 +0,0 @@
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@v3
- 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'

View File

@@ -1,56 +0,0 @@
name: urchin tests
on: [push]
jobs:
tests:
permissions:
contents: write
name: "tests"
runs-on: ubuntu-latest
defaults:
run:
shell: 'script -q -e -c "${{ matrix.shell }} {0}"'
strategy:
fail-fast: false
matrix:
include:
- shell: bash
suite: install_script
# shell:
# - bash
# suite:
# - install_script
steps:
- name: Harden Runner
uses: step-security/harden-runner@v1
with:
allowed-endpoints:
github.com:443
registry.npmjs.org:443
raw.githubusercontent.com:443
nodejs.org:443
iojs.org:443
- uses: actions/checkout@v3
- run: sudo ${{ matrix.shell }} --version 2> /dev/null || dpkg -s ${{ matrix.shell }} 2> /dev/null || which ${{ matrix.shell }}
- run: curl --version
- run: wget --version
- uses: ljharb/actions/node/run@main
name: 'npm install && version checks'
with:
node-version: 'lts/*'
skip-ls-check: true
shell-command: echo installed
- run: npm ls urchin
- run: env
- run: make TERM=xterm-256color TEST_SUITE="${{ matrix.suite }}" SHELL="${{ matrix.shell }}" URCHIN="$(npx which urchin)" test-${{ matrix.shell }}
nvm:
name: 'all test suites, all shells'
needs: [tests]
runs-on: ubuntu-latest
steps:
- run: 'echo tests completed'

View File

@@ -1,37 +0,0 @@
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@v3
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@v3
with:
node-version: '16'
- run: npm install
- run: npm run doctoc
- name: commit changes
uses: ljharb/actions-js-build/commit@v3+amendpush
with:
amend: true
force: true

View File

@@ -1,190 +0,0 @@
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:
continue-on-error: true
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/' # see https://archlinux.org/mirrors/clarkson.edu/1603/ for uptime status
export SITE='https://mirrors.kernel.org/sourceware/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:
continue-on-error: true
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 # fails
- Ubuntu-20.04
- Ubuntu-18.04
npm-node-version:
- '--lts'
- '21'
- '18'
- '16'
- '14'
- '12'
- '10'
exclude:
- wsl-distrib: Ubuntu-18.04
npm-node-version: '--lts'
- wsl-distrib: Ubuntu-18.04
npm-node-version: '21'
- wsl-distrib: Ubuntu-18.04
npm-node-version: '18'
method:
- ''
- 'script'
steps:
- uses: Vampire/setup-wsl@v2
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 }}
node -v
wsl_matrix_unofficial:
continue-on-error: true
name: 'WSL nvm install'
defaults:
run:
shell: wsl-bash {0}
runs-on: windows-latest
env:
WSLENV: NVM_INSTALL_GITHUB_REPO:NVM_INSTALL_VERSION:/p
NVM_NODEJS_ORG_MIRROR: https://unofficial-builds.nodejs.org/download/release
strategy:
fail-fast: false
matrix:
wsl-distrib:
- Alpine
npm-node-version:
- '--lts'
- '21'
- '18'
- '16'
- '14'
- '12'
- '11'
- '10'
method:
- ''
- 'script'
steps:
- uses: Vampire/setup-wsl@v2
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_NODEJS_ORG_MIRROR=${{ env.NVM_NODEJS_ORG_MIRROR }} nvm install ${{ matrix.npm-node-version }}
nvm_windows:
name: 'tests, on windows'
permissions:
contents: none
needs: [wsl_matrix, wsl_matrix_unofficial, cygwin_matrix, msys_matrix, msys_fail_install]
runs-on: ubuntu-latest
steps:
- run: 'echo tests completed'

View File

@@ -1,5 +1,6 @@
language: generic
dist: focal
dist: xenial
sudo: required
addons:
apt:
packages:
@@ -11,60 +12,28 @@ addons:
cache:
ccache: true
directories:
- $HOME/.npm
- $TRAVIS_BUILD_DIR/.cache
- $TRAVIS_BUILD_DIR/node_modules
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
- curl --version
- wget --version
- bash --version | head
- zsh --version
- dpkg -s dash | grep ^Version | awk '{print $2}'
# install python
- pyenv install 2.7.18
- pyenv local 2.7.18 || echo 'pyenv failed'
- python -V
- shellcheck --version
install:
- if [ -z "${SHELLCHECK-}" ]; then nvm install 16 && nvm unalias default && npm install && npm prune && npm ls urchin doctoc eclint dockerfile_lint; fi
- if [ -z "${SHELLCHECK-}" ]; then nvm install node && npm install && npm prune && npm ls urchin doctoc eclint dockerfile_lint; fi
- '[ -z "$WITHOUT_CURL" ] || sudo apt-get remove curl -y'
script:
- if [ -n "${SHELL-}" ] && [ -n "${TEST_SUITE}" ]; then if [ "${TEST_SUITE}" = 'installation_iojs' ] || [ "${TEST_SUITE}" = 'xenial' ]; 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 "${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 "${DOCKERFILE_LINT-}" ]; then npm run dockerfile_lint ; 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
before_cache:
- if [ -n "$WITHOUT_CURL" ]; then sudo apt-get install curl -y ; fi
jobs:
include:
- env: SHELL=bash TEST_SUITE=installation_node
dist: xenial
- env: SHELL=bash TEST_SUITE=installation_node WITHOUT_CURL=1
dist: xenial
- env: SHELL=sh TEST_SUITE=installation_node
dist: xenial
- env: SHELL=sh TEST_SUITE=installation_node WITHOUT_CURL=1
dist: xenial
- env: SHELL=dash TEST_SUITE=installation_node
dist: xenial
- env: SHELL=dash TEST_SUITE=installation_node WITHOUT_CURL=1
dist: xenial
- env: SHELL=zsh TEST_SUITE=installation_node
dist: xenial
- env: SHELL=zsh TEST_SUITE=installation_node WITHOUT_CURL=1
dist: xenial
#- env: SHELL=ksh TEST_SUITE=installation_node
# dist: xenial
#- env: SHELL=ksh TEST_SUITE=installation_node WITHOUT_CURL=1
# dist: xenial
- env: SHELL=bash TEST_SUITE=xenial
dist: xenial
- env: SHELL=sh TEST_SUITE=xenial
dist: xenial
- env: SHELL=dash TEST_SUITE=xenial
dist: xenial
- env: SHELL=zsh TEST_SUITE=xenial
dist: xenial
#- env: SHELL=ksh TEST_SUITE=xenial
# dist: xenial
- if [ -n "${NODE-}" ]; then . nvm.sh && set -ex && nvm install --latest-npm "${NODE}" && npm --version; fi
env:
global:
- CXX=g++
@@ -73,21 +42,37 @@ env:
- PATH="/usr/lib/ccache/:$PATH"
- NVM_DIR="${TRAVIS_BUILD_DIR}"
matrix:
- MAKE_RELEASE=true
- DOCTOCCHECK=true
- SHELLCHECK=true
- ECLINT=true
- DOCKERFILE_LINT=true
- SHELL=bash TEST_SUITE=install_script
- SHELL=sh TEST_SUITE=fast
- SHELL=dash TEST_SUITE=fast
- SHELL=bash TEST_SUITE=fast
- SHELL=zsh TEST_SUITE=fast
# - SHELL=ksh TEST_SUITE=fast
# - SHELL=ksh TEST_SUITE=fast
- SHELL=sh TEST_SUITE=sourcing
- SHELL=dash TEST_SUITE=sourcing
- SHELL=bash TEST_SUITE=sourcing
- SHELL=zsh TEST_SUITE=sourcing
# - SHELL=ksh TEST_SUITE=sourcing
# - SHELL=ksh TEST_SUITE=sourcing
- SHELL=sh TEST_SUITE=slow
- SHELL=dash TEST_SUITE=slow
- SHELL=bash TEST_SUITE=slow
- SHELL=zsh TEST_SUITE=slow
# - SHELL=ksh TEST_SUITE=slow
# - SHELL=ksh TEST_SUITE=slow
- SHELL=sh TEST_SUITE=installation_node
- SHELL=sh TEST_SUITE=installation_node WITHOUT_CURL=1
- SHELL=dash TEST_SUITE=installation_node
- SHELL=dash TEST_SUITE=installation_node WITHOUT_CURL=1
- SHELL=bash TEST_SUITE=installation_node
- SHELL=bash TEST_SUITE=installation_node WITHOUT_CURL=1
- SHELL=zsh TEST_SUITE=installation_node
- SHELL=zsh TEST_SUITE=installation_node WITHOUT_CURL=1
# - SHELL=ksh TEST_SUITE=installation_node
# - SHELL=ksh TEST_SUITE=installation_node WITHOUT_CURL=1
- SHELL=sh TEST_SUITE=installation_iojs
- SHELL=sh TEST_SUITE=installation_iojs WITHOUT_CURL=1
- SHELL=dash TEST_SUITE=installation_iojs
@@ -96,5 +81,17 @@ env:
- SHELL=bash TEST_SUITE=installation_iojs WITHOUT_CURL=1
- SHELL=zsh TEST_SUITE=installation_iojs
- SHELL=zsh TEST_SUITE=installation_iojs WITHOUT_CURL=1
# - SHELL=ksh TEST_SUITE=installation_iojs
# - SHELL=ksh TEST_SUITE=installation_iojs WITHOUT_CURL=1
# - SHELL=ksh TEST_SUITE=installation_iojs
# - SHELL=ksh TEST_SUITE=installation_iojs WITHOUT_CURL=1
- NODE=10 TEST="nvm install-latest-npm"
- NODE=9 TEST="nvm install-latest-npm"
- NODE=8 TEST="nvm install-latest-npm"
- NODE=7 TEST="nvm install-latest-npm"
- NODE=6 TEST="nvm install-latest-npm"
- NODE=5 TEST="nvm install-latest-npm"
- NODE=5.9 TEST="nvm install-latest-npm"
- NODE=4 TEST="nvm install-latest-npm"
- NODE=4.6 TEST="nvm install-latest-npm"
- NODE=4.5 TEST="nvm install-latest-npm"
- NODE=4.4 TEST="nvm install-latest-npm"
- NODE=2 TEST="nvm install-latest-npm"

View File

@@ -1,125 +1,81 @@
# 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/HEAD/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.
In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, sex characteristics, gender identity and expression,
level of experience, education, socio-economic status, nationality, personal
appearance, race, religion, or sexual identity and orientation.
## Our Standards
Examples of behavior that contributes to a positive environment for our community include:
Examples of behavior that contributes to creating a positive environment
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
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
Examples of unacceptable behavior include:
Examples of unacceptable behavior by participants 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
* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/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
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
## Enforcement Responsibilities
## Our 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.
Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.
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.
Project maintainers 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, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.
## 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.
This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.
## 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.
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at ljharb@gmail.com. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.
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.
Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.
## 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].
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
[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
For answers to common questions about this code of conduct, see
https://www.contributor-covenant.org/faq
## OpenJS Foundation
As a member of the OpenJS Foundation, this project also follows the Foundations overarching
[Code of Conduct](https://github.com/openjs-foundation/cross-project-council/blob/master/CODE_OF_CONDUCT.md).

View File

@@ -1,115 +1,21 @@
# Contributing
:+1::tada: First off, thanks for taking the time to contribute to `nvm`! :tada::+1:
Thanks for contributing to `nvm`!
We love pull requests and issues, they're our favorite.
The following is a set of guidelines for contributing to `nvm` managed by [@LJHarb](https://github.com/ljharb), which is hosted on GitHub. These are mostly guidelines, not rules. Use your best judgment, and feel free to propose changes to this document in a pull request.
However, before submitting, please review the following:
# How Can I Contribute?
For bug reports:
There are lots of ways to get involved. Here are some suggestions of things we'd love some help with.
- 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.
## Resolving existing issues
You can consider helping out with issues already requiring attention - look for a "help wanted" label.
### How Do I Submit a (Good) Bug Report? :bug:
Explain the problem and include additional details to help maintainers reproduce the problem:
* **Use a clear and descriptive title** for the issue to identify the problem.
* **Describe the exact steps which reproduce the problem** in as many details as possible. For example, start by explaining which command exactly you used in the terminal. When listing steps, **don't just say what you did, but explain how you did it**. For example, if you moved the cursor to the end of a line, explain if you used the mouse, or a keyboard shortcut or a command, and if so which one?
* **Provide specific examples to demonstrate the steps**. Include links to files or Github projects, or copy/pasteable snippets, which you use in those examples. If you're providing snippets in the issue, use [Markdown code blocks](https://help.github.com/articles/markdown-basics/#multiple-lines).
* **Describe the behavior you observed after following the steps** and point out what exactly is the problem with that behavior.
* **Explain which behavior you expected to see instead and why.**
* **Provide as much context as possible** in order to help others verify and ultimately fix the issue. This includes giving us as much details as possible about your environment, so we can more easily confirm the problem.
## Documentation
We are happy to welcome contributions from anyone willing to improve documentation by adding missing information or making it more consistent and coherent.
# Dev Environment
Please refer to the [README](README.md) for complete instructions how to install, update, as well as troubleshoot `nvm` in your environment depending on your Operating System.
# Style Guide / Coding conventions
### Pull requests
#### Before creating a pull request
For pull requests:
- 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 maintain consistent whitespace - 2-space indentation, trailing newlines in all files, etc.
- Any time you make a change to your PR, please rebase freshly on top of the default branch. Nobody likes merge commits.
- Any time you make a change to your PR, please rebase freshly on top of master. Nobody likes merge commits.
Even if you don't have all of these items covered, please still feel free to submit a PR/issue! Someone else may be inspired and volunteer to complete it for you.
#### How to create a pull request
Create a new branch
```
git checkout -b issue1234
```
Commit the changes to your branch, including a coherent commit message that follows our [standards](#commit-messages)
```
git commit -a
```
Before sending the pull request, make sure your code is running on the latest available code by rebasing onto the upstream source
```
git fetch upstream
git rebase upstream/main
```
Verify your changes
```
npm test
```
Push your changes
```
git push origin issue1234
```
Send the [pull request](https://docs.github.com/en/pull-requests), make requested changes, and get merged.
### Commit Messages
* Limit the first line of the commit message (message summary) to 72 characters or less.
* Use the present tense ("Add feature" not "Added feature") and imperative mood ("Move cursor to..." not "Moves cursor to...") when providing a description of what you did.
* If your PR addresses an issue, reference it in the body of the commit message.
* See the rest of the conventions [here](https://gist.github.com/ljharb/772b0334387a4bee89af24183114b3c7)
#### Commit message example
```
[Tag]: Short description of what you did
Longer description here if necessary
Fixes #1234
```
> **Note:** Add co-authors to your commit message for commits with multiple authors
```
Co-authored-by: Name Here <email@here>
```
# Code of Conduct
[Code of Conduct](https://github.com/nvm-sh/nvm/blob/HEAD/CODE_OF_CONDUCT.md)
# Where can I ask for help?
If you have any questions, please contact [@LJHarb](mailto:ljharb@gmail.com).
Thanks again!

View File

@@ -6,7 +6,9 @@
# 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.
FROM ubuntu:22.04
# Use Ubuntu Trusty Tahr as base image as we're using on Travis CI
# I also tested with Ubuntu 16.04, should be good with it!
FROM ubuntu:14.04
LABEL maintainer="Peter Dave Hello <hsu@peterdavehello.org>"
LABEL name="nvm-dev-env"
LABEL version="latest"
@@ -18,12 +20,15 @@ SHELL ["/bin/bash", "-o", "pipefail", "-c"]
ENV DEBIAN_FRONTEND noninteractive
# ShellCheck version
ENV SHELLCHECK_VERSION=0.7.0
ENV SHELLCHECK_VERSION=0.6.0
# Pick a Ubuntu apt mirror site for better speed
# ref: https://launchpad.net/ubuntu/+archivemirrors
ENV UBUNTU_APT_SITE ubuntu.cs.utah.edu
# Disable src package source
RUN sed -i 's/^deb-src\ /\#deb-src\ /g' /etc/apt/sources.list
# Replace origin apt package site with the mirror site
RUN sed -E -i "s/([a-z]+.)?archive.ubuntu.com/$UBUNTU_APT_SITE/g" /etc/apt/sources.list
RUN sed -i "s/security.ubuntu.com/$UBUNTU_APT_SITE/g" /etc/apt/sources.list
@@ -38,7 +43,6 @@ RUN apt update && \
file \
openssl \
libssl-dev \
locales \
ca-certificates \
ssh \
wget \
@@ -51,20 +55,24 @@ RUN apt update && \
curl \
git \
jq \
realpath \
zsh \
ksh \
gcc \
g++ \
gcc-4.8 \
g++-4.8 \
xz-utils \
build-essential \
bash-completion && \
apt-get clean
RUN wget https://github.com/koalaman/shellcheck/releases/download/v$SHELLCHECK_VERSION/shellcheck-v$SHELLCHECK_VERSION.linux.x86_64.tar.xz -O- | \
# ShellCheck with Ubuntu 14.04 container workaround
RUN wget https://storage.googleapis.com/shellcheck/shellcheck-v$SHELLCHECK_VERSION.linux.x86_64.tar.xz -O- | \
tar xJvf - shellcheck-v$SHELLCHECK_VERSION/shellcheck && \
mv shellcheck-v$SHELLCHECK_VERSION/shellcheck /bin && \
rmdir shellcheck-v$SHELLCHECK_VERSION
RUN shellcheck -V
rmdir shellcheck-v$SHELLCHECK_VERSION && \
touch /tmp/libc.so.6 && \
echo "alias shellcheck='LD_LIBRARY_PATH=/tmp /bin/shellcheck'" >> /etc/bash.bashrc
RUN LD_LIBRARY_PATH=/tmp shellcheck -V
# Set locale
RUN locale-gen en_US.UTF-8
@@ -83,7 +91,7 @@ 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"
RUN chown nvm:nvm -R "home/nvm/.nvm"
# Set sudoer for "nvm"
RUN echo 'nvm ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers

View File

@@ -1,10 +0,0 @@
# `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

@@ -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; } \
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; }; \
replace "$$old_ver" "$$new_ver" $(VERSIONED_FILES) && \
replace "$$old_ver" "$$new_ver" -- $(VERSIONED_FILES) && \
git commit -m "v$$new_ver" $(VERSIONED_FILES) && \
git tag -a "v$$new_ver"

View File

@@ -1,49 +0,0 @@
# `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

621
README.md
View File

@@ -1,111 +1,62 @@
<a href="https://github.com/nvm-sh/logos">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/nvm-sh/logos/HEAD/nvm-logo-white.svg" />
<img src="https://raw.githubusercontent.com/nvm-sh/logos/HEAD/nvm-logo-color.svg" height="50" alt="nvm project logo" />
</picture>
</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.35.0-yellow.svg)][4] [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/684/badge)](https://bestpractices.coreinfrastructure.org/projects/684)
<br />
`nvm` is an <img alt="OpenJS Foundation" src="https://raw.githubusercontent.com/openjs-foundation/cross-project-council/master/logos/openjsf-color.png" width="150" align="left" /> project, and we follow our <a href="https://github.com/nvm-sh/nvm/blob/master/CODE_OF_CONDUCT.md">Code of Conduct</a>.
<br /><br />
# 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.7-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 -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
## Table of Contents
- [Intro](#intro)
- [About](#about)
- [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)
- [Installation and Update](#installation-and-update)
- [Install & Update script](#install--update-script)
- [Ansible](#ansible)
- [Verify Installation](#verify-installation)
- [Verify installation](#verify-installation)
- [Important Notes](#important-notes)
- [Git Install](#git-install)
- [Git install](#git-install)
- [Manual Install](#manual-install)
- [Manual Upgrade](#manual-upgrade)
- [Manual upgrade](#manual-upgrade)
- [Usage](#usage)
- [Long-term Support](#long-term-support)
- [Migrating Global Packages While Installing](#migrating-global-packages-while-installing)
- [Default Global Packages From File While Installing](#default-global-packages-from-file-while-installing)
- [Long-term support](#long-term-support)
- [Migrating global packages while installing](#migrating-global-packages-while-installing)
- [Default global packages from file while installing](#default-global-packages-from-file-while-installing)
- [io.js](#iojs)
- [System Version of Node](#system-version-of-node)
- [Listing Versions](#listing-versions)
- [Setting Custom Colors](#setting-custom-colors)
- [Persisting custom colors](#persisting-custom-colors)
- [System version of node](#system-version-of-node)
- [Listing versions](#listing-versions)
- [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)
- [Deeper Shell Integration](#deeper-shell-integration)
- [Calling `nvm use` automatically in a directory with a `.nvmrc` file](#calling-nvm-use-automatically-in-a-directory-with-a-nvmrc-file)
- [bash](#bash)
- [zsh](#zsh)
- [fish](#fish)
- [Running Tests](#running-tests)
- [Environment variables](#environment-variables)
- [Bash Completion](#bash-completion)
- [bash](#bash)
- [Automatically call `nvm use`](#automatically-call-nvm-use)
- [zsh](#zsh)
- [Calling `nvm use` automatically in a directory with a `.nvmrc` file](#calling-nvm-use-automatically-in-a-directory-with-a-nvmrc-file)
- [License](#license)
- [Running tests](#running-tests)
- [Bash completion](#bash-completion)
- [Usage](#usage-1)
- [Compatibility Issues](#compatibility-issues)
- [Installing nvm on Alpine Linux](#installing-nvm-on-alpine-linux)
- [Alpine Linux 3.13+](#alpine-linux-313)
- [Alpine Linux 3.5 - 3.12](#alpine-linux-35---312)
- [Uninstalling / Removal](#uninstalling--removal)
- [Removal](#removal)
- [Manual Uninstall](#manual-uninstall)
- [Docker For Development Environment](#docker-for-development-environment)
- [Docker for development environment](#docker-for-development-environment)
- [Problems](#problems)
- [macOS Troubleshooting](#macos-troubleshooting)
- [WSL Troubleshooting](#wsl-troubleshooting)
- [Maintainers](#maintainers)
- [License](#license)
- [Copyright notice](#copyright-notice)
- [Mac OS "troubleshooting"](#mac-os-troubleshooting)
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
## Intro
## Installation and Update
`nvm` allows you to quickly install and use different versions of node via the command line.
**Example:**
```sh
$ 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
```
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
### 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
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.0/install.sh | bash
```
```sh
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.0/install.sh | bash
```
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`).
Running either of the above commands downloads a script and runs it. The script clones the nvm repository to `~/.nvm`, and adds the source lines from the snippet below to your profile (`~/.bash_profile`, `~/.zshrc`, `~/.profile`, or `~/.bashrc`).
<a id="profile_snippet"></a>
```sh
@@ -113,71 +64,42 @@ export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || pr
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
```
#### Additional Notes
<sub>**Note:** If the environment variable `$XDG_CONFIG_HOME` is present, it will place the `nvm` files there.</sub>
- If the environment variable `$XDG_CONFIG_HOME` is present, it will place the `nvm` files there.</sub>
**Note:** 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 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.
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.
- The installer can use `git`, `curl`, or `wget` to download `nvm`, whichever is available.
<sub>*NB. The installer can use `git`, `curl`, or `wget` to download `nvm`, whatever is available.*</sub>
- 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.7/install.sh | bash'`
**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.
#### Troubleshooting on Linux
**Note:** 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))
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.
Alternatively, you can run the following commands for the different shells on the command line:
**Note:** On OS X, if you get `nvm: command not found` after running the install script, one of the following might be the reason:
*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.
- Your system may not have a `.bash_profile` file where the command is set up. 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, you may try the following:
- Open your `.bash_profile` (or `~/.zshrc`, `~/.profile`, or `~/.bashrc`) and add the following line of code: `source ~/<your_profile_file>`. E.g. `source ~/.bashrc` or `source ~/.zshrc`.
- If the above don't work, try adding the [snippet from the install section](#profile_snippet) that finds the correct nvm directory and loads nvm, to your profile (`~/.bash_profile`, `~/.zshrc`, `~/.profile`, or `~/.bashrc`).
- 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 following 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 Apple Silicon 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.
- For more information about this issue and possible workarounds, please [refer here](https://github.com/nvm-sh/nvm/issues/576)
#### Ansible
You can use a task:
You can use a task:
```yaml
- name: Install nvm
ansible.builtin.shell: >
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
```
- name: nvm
shell: >
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.0/install.sh | bash
args:
creates: "{{ ansible_env.HOME }}/.nvm/nvm.sh"
```
### Verify Installation
### Verify installation
To verify that nvm has been installed, do:
@@ -187,17 +109,14 @@ 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.
**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
If you're running a system without prepackaged binary available, which means you're going to install node 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` also supports 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:
**Note:** `nvm` does not support Windows (see [#284](https://github.com/nvm-sh/nvm/issues/284)), but may work in WSL (Windows Subsystem for Linux) depending on the version of WSL. For Windows, two alternatives exist, which are neither supported nor developed by us:
- [nvm-windows](https://github.com/coreybutler/nvm-windows)
- [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:
@@ -209,12 +128,12 @@ If you're running a system without prepackaged binary available, which means you
**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] node on FreeBSD may need to be patched](https://github.com/nvm-sh/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)
**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)](https://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)](http://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:
@@ -228,14 +147,14 @@ Homebrew installation is not supported. If you have issues with homebrew-install
**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+):
1. clone this repo in the root of your user profile
- `cd ~/` from anywhere then `git clone https://github.com/nvm-sh/nvm.git .nvm`
1. `cd ~/.nvm` and check out the latest version with `git checkout v0.39.7`
1. activate `nvm` by sourcing it from your shell: `. ./nvm.sh`
- `cd ~/` from anywhere then `git clone https://github.com/nvm-sh/nvm.git .nvm`
1. `cd ~/.nvm` and check out the latest version with `git checkout v0.35.0`
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:
(you may have to add to more than one of the above files)
@@ -264,10 +183,9 @@ Now add these lines to your `~/.bashrc`, `~/.profile`, or `~/.zshrc` file to hav
```sh
export NVM_DIR="$HOME/.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+):
@@ -295,7 +213,7 @@ 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
nvm install 6.14.4 # or 10.10.0, 8.9.1, etc
```
The first version installed becomes the default. New shells will start with the default version of node (e.g., `nvm alias default`).
@@ -327,17 +245,17 @@ nvm exec 4.2 node --version
You can also get the path to the executable to where it was installed:
```sh
nvm which 12.22
nvm which 5.0
```
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:
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:
- `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/)
- `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).
### Long-term Support
### Long-term support
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:
@@ -351,18 +269,12 @@ Node has a [schedule](https://github.com/nodejs/Release#release-schedule) for lo
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.
To get the latest LTS version of node and migrate your existing installed packages, use
```sh
nvm install --reinstall-packages-from=current 'lts/*'
```
### Migrating Global Packages While Installing
### Migrating global packages while installing
If you want to install a new version of Node.js and migrate npm packages from a previous version:
```sh
nvm install --reinstall-packages-from=node node
nvm install node --reinstall-packages-from=node
```
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.
@@ -370,8 +282,8 @@ This will first use "nvm version node" to identify the current version you're mi
You can also install and migrate npm packages from specific versions of Node like this:
```sh
nvm install --reinstall-packages-from=5 6
nvm install --reinstall-packages-from=iojs v4.2
nvm install 6 --reinstall-packages-from=5
nvm install v4.2 --reinstall-packages-from=iojs
```
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.
@@ -379,7 +291,7 @@ Note that reinstalling packages _explicitly does not update the npm version_ —
To update npm at the same time add the `--latest-npm` flag, like this:
```sh
nvm install --reinstall-packages-from=default --latest-npm 'lts/*'
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:
@@ -387,10 +299,10 @@ or, you can at any time run the following command to get the latest supported np
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.
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
### 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.
@@ -413,12 +325,12 @@ nvm install iojs
If you want to install a new version of io.js and migrate npm packages from a previous version:
```sh
nvm install --reinstall-packages-from=iojs iojs
nvm install iojs --reinstall-packages-from=iojs
```
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":
@@ -427,7 +339,7 @@ nvm use system
nvm run system --version
```
### Listing Versions
### Listing versions
If you want to see what versions are installed:
@@ -441,68 +353,27 @@ If you want to see what versions are available to install:
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`):
`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:
```sh
nvm deactivate
```
### Set default node version
To set a default Node version to be used in any new shell, use the alias 'default':
```sh
nvm alias default node # this refers to the latest installed version of node
nvm alias default 18 # this refers to the latest installed v18.x version of node
nvm alias default 18.12 # this refers to the latest installed v18.12.x version of node
nvm alias default node
```
### Use a mirror of node binaries
To use a mirror of the node binaries, set `$NVM_NODEJS_ORG_MIRROR`:
```sh
@@ -538,9 +409,7 @@ $ echo "lts/*" > .nvmrc # to default to the latest LTS 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 use:
Then when you run nvm:
```sh
$ nvm use
@@ -548,91 +417,81 @@ Found '/path/to/project/.nvmrc' with version <5.9>
Now using node v5.9.1 (npm v3.7.3)
```
Running nvm install will also switch over to the correct version, but if the correct node version isn't already installed, it will install it for you.
```sh
$ nvm install
Found '/path/to/project/.nvmrc' with version <5.9>
Downloading and installing node v5.9.1...
Downloading https://nodejs.org/dist/v5.9.1/node-v5.9.1-linux-x64.tar.xz...
#################################################################################### 100.0%
Computing checksum with sha256sum
Checksums matched!
Now using node v5.9.1 (npm v3.7.3)
```
`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.
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.
### 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` maintainers. 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` development team. Please [report issues to the `avn` team](https://github.com/wbyoung/avn/issues/new).
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).
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
#### Calling `nvm use` automatically in a directory with a `.nvmrc` file
In your profile (`~/.bash_profile`, `~/.zshrc`, `~/.profile`, or `~/.bashrc`), add the following to `nvm use` whenever you enter a new directory:
##### 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 | command tr -d '\n')"
find-up () {
path=$(pwd)
while [[ "$path" != "" && ! -e "$path/$1" ]]; do
path=${path%/*}
done
echo "$path"
}
cdnvm(){
cd "$@";
nvm_path=$(find-up .nvmrc | tr -d '[:space:]')
# If there are no .nvmrc file, use the default nvm version
if [[ ! $nvm_path = *[^[:space:]]* ]]; then
declare default_version
default_version="$(nvm version default)"
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)
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
if [[ $(nvm current) != "$default_version" ]]; then
nvm use default;
fi
elif [[ -s "${nvm_path}/.nvmrc" && -r "${nvm_path}/.nvmrc" ]]; then
elif [[ -s $nvm_path/.nvmrc && -r $nvm_path/.nvmrc ]]; then
declare nvm_version
nvm_version=$(<"${nvm_path}"/.nvmrc)
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}" | command tail -1 | command tr -d '\->*' | command tr -d '[:space:]')
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}";
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'
cdnvm "$PWD" || exit
```
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
This shell function will install (if needed) and `nvm use` the specified Node version when an `.nvmrc` is found, and `nvm use default` otherwise.
##### Calling `nvm use` automatically in a directory with a `.nvmrc` file
Put this into your `$HOME/.zshrc` to call `nvm use` automatically whenever you enter a directory that contains an
`.nvmrc` file with a string telling nvm which node to `use`:
@@ -640,68 +499,41 @@ Put this into your `$HOME/.zshrc` to call `nvm use` automatically whenever you e
```zsh
# place this after nvm initialization!
autoload -U add-zsh-hook
load-nvmrc() {
local nvmrc_path
nvmrc_path="$(nvm_find_nvmrc)"
local node_version="$(nvm version)"
local nvmrc_path="$(nvm_find_nvmrc)"
if [ -n "$nvmrc_path" ]; then
local nvmrc_node_version
nvmrc_node_version=$(nvm version "$(cat "${nvmrc_path}")")
local nvmrc_node_version=$(nvm version "$(cat "${nvmrc_path}")")
if [ "$nvmrc_node_version" = "N/A" ]; then
nvm install
elif [ "$nvmrc_node_version" != "$(nvm version)" ]; then
elif [ "$nvmrc_node_version" != "$node_version" ]; then
nvm use
fi
elif [ -n "$(PWD=$OLDPWD nvm_find_nvmrc)" ] && [ "$(nvm version)" != "$(nvm version default)" ]; then
elif [ "$node_version" != "$(nvm version default)" ]; then
echo "Reverting to nvm default version"
nvm use default
fi
}
add-zsh-hook chpwd load-nvmrc
load-nvmrc
```
##### fish
## License
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
nvm is released under the MIT license.
# ~/.config/fish/functions/nvm_find_nvmrc.fish
function nvm_find_nvmrc
bass source ~/.nvm/nvm.sh --no-use ';' nvm_find_nvmrc
end
# ~/.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
Copyright (C) 2010 Tim Caswell and Jordan Harband
# ~/.config/fish/config.fish
# You must call it on initialization or listening to directory switching won't work
load_nvm > /dev/stderr
```
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:
## Running Tests
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
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:
@@ -724,20 +556,7 @@ Run all of the tests like this:
Nota bene: Avoid running nvm while the tests are running.
## 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
## Bash completion
To activate, you need to source `bash_completion`:
@@ -750,44 +569,44 @@ Put the above sourcing line just below the sourcing line for nvm in your profile
### Usage
nvm:
> $ nvm <kbd>Tab</kbd>
> `$ nvm` <kbd>Tab</kbd>
```sh
alias deactivate install list-remote reinstall-packages uninstall version
cache exec install-latest-npm ls run unload version-remote
current help list ls-remote unalias use which
```
alias deactivate install ls run unload
clear-cache exec list ls-remote unalias use
current help list-remote reinstall-packages uninstall version
```
nvm alias:
> $ nvm alias <kbd>Tab</kbd>
> `$ nvm alias` <kbd>Tab</kbd>
```sh
default iojs lts/* lts/argon lts/boron lts/carbon lts/dubnium lts/erbium node stable unstable
```
default
```
> $ nvm alias my_alias <kbd>Tab</kbd>
> `$ nvm alias my_alias` <kbd>Tab</kbd>
```sh
v10.22.0 v12.18.3 v14.8.0
```
v0.6.21 v0.8.26 v0.10.28
```
nvm use:
> `$ nvm use` <kbd>Tab</kbd>
> $ nvm use <kbd>Tab</kbd>
```
my_alias default v10.22.0 v12.18.3 v14.8.0
my_alias default v0.6.21 v0.8.26 v0.10.28
```
nvm uninstall:
> `$ nvm uninstall` <kbd>Tab</kbd>
> $ nvm uninstall <kbd>Tab</kbd>
```
my_alias default v10.22.0 v12.18.3 v14.8.0
my_alias default v0.6.21 v0.8.26 v0.10.28
```
## Compatibility Issues
`nvm` will encounter some issues if you have some non-default settings set. (see [#606](https://github.com/creationix/nvm/issues/606))
`nvm` will encounter some issues if you have some non-default settings set. (see [#606](/../../issues/606))
The following are known to cause issues:
Inside `~/.npmrc`:
@@ -811,34 +630,24 @@ set -e
## Installing nvm on Alpine Linux
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).
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).
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.
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:
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:
### 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.7/install.sh | bash
```
### Alpine Linux 3.5 - 3.12
```sh
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/nvm-sh/nvm/v0.39.7/install.sh | bash
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.0/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.
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).
<a id="removal"></a>
## Uninstalling / Removal
## Removal
### Manual Uninstall
@@ -856,9 +665,9 @@ export NVM_DIR="$HOME/.nvm"
[[ -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 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:
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:
```sh
$ docker build -t nvm-dev .
@@ -904,7 +713,7 @@ 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/nvm-sh/nvm/issues/658))
## macOS Troubleshooting
## Mac OS "troubleshooting"
**nvm node version not found in vim shell**
@@ -916,143 +725,9 @@ sudo chmod ugo-x /usr/libexec/path_helper
More on this issue in [dotphiles/dotzsh](https://github.com/dotphiles/dotzsh#mac-os-x).
**nvm is not compatible with the npm config "prefix" option**
Some solutions for this issue can be found [here](https://github.com/nvm-sh/nvm/issues/1245)
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.7/install.sh
[3]: https://app.travis-ci.com/nvm-sh/nvm
[4]: https://github.com/nvm-sh/nvm/releases/tag/v0.39.7
[Urchin]: https://git.sdf.org/tlevine/urchin
[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 Apple Silicon chips**
Experimental support for the Apple Silicon chip 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 Apple Silicon 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 Apple Silicon 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-90.39.776)
- 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.
## WSL Troubleshooting
If you've encountered this error on WSL-2:
```sh
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- 0:00:09 --:--:-- 0curl: (6) Could not resolve host: raw.githubusercontent.com
```
It may be due to your antivirus, VPN, or other reasons.
Where you can `ping 8.8.8.8` while you can't `ping google.com`
This could simply be solved by running this in your root directory:
```sh
sudo rm /etc/resolv.conf
sudo bash -c 'echo "nameserver 8.8.8.8" > /etc/resolv.conf'
sudo bash -c 'echo "[network]" > /etc/wsl.conf'
sudo bash -c 'echo "generateResolvConf = false" >> /etc/wsl.conf'
sudo chattr +i /etc/resolv.conf
```
This deletes your `resolv.conf` file that is 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.
You can check the contents of the file by running:
```sh
cat /etc/resolv.conf
```
## 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/)
[2]: https://github.com/nvm-sh/nvm/blob/v0.35.0/install.sh
[3]: https://travis-ci.org/nvm-sh/nvm
[4]: https://github.com/nvm-sh/nvm/releases/tag/v0.35.0
[Urchin]: https://github.com/scraperwiki/urchin
[Fish]: http://fishshell.com

View File

@@ -58,7 +58,7 @@ __nvm_aliases() {
declare aliases
aliases=""
if [ -d "${NVM_DIR}/alias" ]; then
aliases="$(command cd "${NVM_DIR}/alias" && command find "${PWD}" -type f | command sed "s:${PWD}/::")"
aliases="$(cd "${NVM_DIR}/alias" && command find "${PWD}" -type f | command sed "s:${PWD}/::")"
fi
echo "${aliases} node stable unstable iojs"
}
@@ -84,16 +84,12 @@ __nvm() {
# called bashcompinit that will create a complete in ZSH. If the user is in
# ZSH, load and run bashcompinit before calling the complete function.
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 compinit && if [[ ${ZSH_DISABLE_COMPFIX-} = true ]]; then
compinit -u
else
compinit
fi
fi
complete -o default -F __nvm nvm

View File

@@ -6,20 +6,6 @@ nvm_has() {
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"
}
@@ -33,14 +19,14 @@ nvm_install_dir() {
}
nvm_latest_version() {
nvm_echo "v0.39.7"
echo "v0.35.0"
}
nvm_profile_is_bash_or_zsh() {
local TEST_PROFILE
TEST_PROFILE="${1-}"
case "${TEST_PROFILE-}" in
*"/.bashrc" | *"/.bash_profile" | *"/.zshrc" | *"/.zprofile")
*"/.bashrc" | *"/.bash_profile" | *"/.zshrc")
return
;;
*)
@@ -52,70 +38,48 @@ nvm_profile_is_bash_or_zsh() {
#
# Outputs the location to NVM depending on:
# * The availability of $NVM_SOURCE
# * The presence of $NVM_INSTALL_GITHUB_REPO
# * The method used ("script" or "git" in the script, defaults to "git")
# NVM_SOURCE always takes precedence unless the method is "script-nvm-exec"
#
nvm_source() {
local NVM_GITHUB_REPO
NVM_GITHUB_REPO="${NVM_INSTALL_GITHUB_REPO:-nvm-sh/nvm}"
if [ "${NVM_GITHUB_REPO}" != 'nvm-sh/nvm' ]; then
{ nvm_echo >&2 "$(cat)" ; } << EOF
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE REPO IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
The default repository for this install is \`nvm-sh/nvm\`,
but the environment variables \`\$NVM_INSTALL_GITHUB_REPO\` is
currently set to \`${NVM_GITHUB_REPO}\`.
If this is not intentional, interrupt this installation and
verify your environment variables.
EOF
fi
local NVM_VERSION
NVM_VERSION="${NVM_INSTALL_VERSION:-$(nvm_latest_version)}"
local NVM_METHOD
NVM_METHOD="$1"
local NVM_SOURCE_URL
NVM_SOURCE_URL="$NVM_SOURCE"
if [ "_$NVM_METHOD" = "_script-nvm-exec" ]; then
NVM_SOURCE_URL="https://raw.githubusercontent.com/${NVM_GITHUB_REPO}/${NVM_VERSION}/nvm-exec"
NVM_SOURCE_URL="https://raw.githubusercontent.com/nvm-sh/nvm/$(nvm_latest_version)/nvm-exec"
elif [ "_$NVM_METHOD" = "_script-nvm-bash-completion" ]; then
NVM_SOURCE_URL="https://raw.githubusercontent.com/${NVM_GITHUB_REPO}/${NVM_VERSION}/bash_completion"
NVM_SOURCE_URL="https://raw.githubusercontent.com/nvm-sh/nvm/$(nvm_latest_version)/bash_completion"
elif [ -z "$NVM_SOURCE_URL" ]; then
if [ "_$NVM_METHOD" = "_script" ]; then
NVM_SOURCE_URL="https://raw.githubusercontent.com/${NVM_GITHUB_REPO}/${NVM_VERSION}/nvm.sh"
NVM_SOURCE_URL="https://raw.githubusercontent.com/nvm-sh/nvm/$(nvm_latest_version)/nvm.sh"
elif [ "_$NVM_METHOD" = "_git" ] || [ -z "$NVM_METHOD" ]; then
NVM_SOURCE_URL="https://github.com/${NVM_GITHUB_REPO}.git"
NVM_SOURCE_URL="https://github.com/nvm-sh/nvm.git"
else
nvm_echo >&2 "Unexpected value \"$NVM_METHOD\" for \$NVM_METHOD"
echo >&2 "Unexpected value \"$NVM_METHOD\" for \$NVM_METHOD"
return 1
fi
fi
nvm_echo "$NVM_SOURCE_URL"
echo "$NVM_SOURCE_URL"
}
#
# Node.js version to install
#
nvm_node_version() {
nvm_echo "$NODE_VERSION"
echo "$NODE_VERSION"
}
nvm_download() {
if nvm_has "curl"; then
curl --fail --compressed -q "$@"
curl --compressed -q "$@"
elif nvm_has "wget"; then
# Emulate curl with wget
ARGS=$(nvm_echo "$@" | command sed -e 's/--progress-bar /--progress=bar /' \
-e 's/--compressed //' \
-e 's/--fail //' \
ARGS=$(echo "$*" | command sed -e 's/--progress-bar /--progress=bar /' \
-e 's/-L //' \
-e 's/--compressed //' \
-e 's/-I /--server-response /' \
-e 's/-s /-q /' \
-e 's/-sS /-nv /' \
-e 's/-o /-O /' \
-e 's/-C - /-c /')
# shellcheck disable=SC2086
@@ -126,76 +90,56 @@ nvm_download() {
install_nvm_from_git() {
local INSTALL_DIR
INSTALL_DIR="$(nvm_install_dir)"
local NVM_VERSION
NVM_VERSION="${NVM_INSTALL_VERSION:-$(nvm_latest_version)}"
if [ -n "${NVM_INSTALL_VERSION:-}" ]; then
# Check if version is an existing ref
if command git ls-remote "$(nvm_source "git")" "$NVM_VERSION" | nvm_grep -q "$NVM_VERSION" ; then
:
# 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
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"
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."
command git --git-dir="$INSTALL_DIR"/.git --work-tree="$INSTALL_DIR" fetch origin tag "$(nvm_latest_version)" --depth=1 2> /dev/null || {
echo >&2 "Failed to update nvm, run 'git fetch' in $INSTALL_DIR yourself."
exit 1
}
else
fetch_error="Failed to fetch origin with $NVM_VERSION. Please report this!"
nvm_echo "=> Downloading nvm from git to '$INSTALL_DIR'"
# Cloning to $INSTALL_DIR
echo "=> Downloading nvm from git to '$INSTALL_DIR'"
command printf '\r=> '
mkdir -p "${INSTALL_DIR}"
if [ "$(ls -A "${INSTALL_DIR}")" ]; then
# Initializing repo
command git init "${INSTALL_DIR}" || {
nvm_echo >&2 'Failed to initialize nvm repo. Please report this!'
echo >&2 'Failed to initialize nvm repo. Please report this!'
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 set-url origin "$(nvm_source)" || {
nvm_echo >&2 'Failed to add remote "origin" (or set the URL). Please report this!'
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
}
else
# Cloning repo
command git clone "$(nvm_source)" --depth=1 "${INSTALL_DIR}" || {
nvm_echo >&2 'Failed to clone nvm repo. Please report this!'
command git -c advice.detachedHead=false clone "$(nvm_source)" -b "$(nvm_latest_version)" --depth=1 "${INSTALL_DIR}" || {
echo >&2 'Failed to clone nvm repo. Please report this!'
exit 2
}
fi
fi
# Try to fetch tag
if command git --git-dir="$INSTALL_DIR"/.git --work-tree="$INSTALL_DIR" fetch origin tag "$NVM_VERSION" --depth=1 2>/dev/null; then
:
# 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
}
command git -c advice.detachedHead=false --git-dir="$INSTALL_DIR"/.git --work-tree="$INSTALL_DIR" checkout -f --quiet "$(nvm_latest_version)"
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
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
else
nvm_echo >&2 "Your version of git is out of date. Please update it!"
command git --no-pager --git-dir="$INSTALL_DIR"/.git --work-tree="$INSTALL_DIR" branch -D master >/dev/null 2>&1
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
fi
fi
nvm_echo "=> Compressing and cleaning up git repository"
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
nvm_echo >&2 "Your version of git is out of date. Please update it!"
echo >&2 "Your version of git is out of date. Please update it!"
fi
if ! command git --git-dir="$INSTALL_DIR"/.git --work-tree="$INSTALL_DIR" gc --auto --aggressive --prune=now ; then
nvm_echo >&2 "Your version of git is out of date. Please update it!"
echo >&2 "Your version of git is out of date. Please update it!"
fi
return
}
@@ -211,15 +155,15 @@ nvm_install_node() {
return 0
fi
nvm_echo "=> Installing Node.js version $NODE_VERSION_LOCAL"
echo "=> Installing Node.js version $NODE_VERSION_LOCAL"
nvm install "$NODE_VERSION_LOCAL"
local CURRENT_NVM_NODE
CURRENT_NVM_NODE="$(nvm_version current)"
if [ "$(nvm_version "$NODE_VERSION_LOCAL")" == "$CURRENT_NVM_NODE" ]; then
nvm_echo "=> Node.js version $NODE_VERSION_LOCAL has been successfully installed"
echo "=> Node.js version $NODE_VERSION_LOCAL has been successfully installed"
else
nvm_echo >&2 "Failed to install Node.js $NODE_VERSION_LOCAL"
echo >&2 "Failed to install Node.js $NODE_VERSION_LOCAL"
fi
}
@@ -236,20 +180,20 @@ install_nvm_as_script() {
# Downloading to $INSTALL_DIR
mkdir -p "$INSTALL_DIR"
if [ -f "$INSTALL_DIR/nvm.sh" ]; then
nvm_echo "=> nvm is already installed in $INSTALL_DIR, trying to update the script"
echo "=> nvm is already installed in $INSTALL_DIR, trying to update the script"
else
nvm_echo "=> Downloading nvm as script to '$INSTALL_DIR'"
echo "=> Downloading nvm as script to '$INSTALL_DIR'"
fi
nvm_download -s "$NVM_SOURCE_LOCAL" -o "$INSTALL_DIR/nvm.sh" || {
nvm_echo >&2 "Failed to download '$NVM_SOURCE_LOCAL'"
echo >&2 "Failed to download '$NVM_SOURCE_LOCAL'"
return 1
} &
nvm_download -s "$NVM_EXEC_SOURCE" -o "$INSTALL_DIR/nvm-exec" || {
nvm_echo >&2 "Failed to download '$NVM_EXEC_SOURCE'"
echo >&2 "Failed to download '$NVM_EXEC_SOURCE'"
return 2
} &
nvm_download -s "$NVM_BASH_COMPLETION_SOURCE" -o "$INSTALL_DIR/bash_completion" || {
nvm_echo >&2 "Failed to download '$NVM_BASH_COMPLETION_SOURCE'"
echo >&2 "Failed to download '$NVM_BASH_COMPLETION_SOURCE'"
return 2
} &
for job in $(jobs -p | command sort)
@@ -257,7 +201,7 @@ install_nvm_as_script() {
wait "$job" || return $?
done
chmod a+x "$INSTALL_DIR/nvm-exec" || {
nvm_echo >&2 "Failed to mark '$INSTALL_DIR/nvm-exec' as executable"
echo >&2 "Failed to mark '$INSTALL_DIR/nvm-exec' as executable"
return 3
}
}
@@ -266,7 +210,7 @@ nvm_try_profile() {
if [ -z "${1-}" ] || [ ! -f "${1}" ]; then
return 1
fi
nvm_echo "${1}"
echo "${1}"
}
#
@@ -282,29 +226,25 @@ nvm_detect_profile() {
fi
if [ -n "${PROFILE}" ] && [ -f "${PROFILE}" ]; then
nvm_echo "${PROFILE}"
echo "${PROFILE}"
return
fi
local DETECTED_PROFILE
DETECTED_PROFILE=''
if [ "${SHELL#*bash}" != "$SHELL" ]; then
if [ -n "${BASH_VERSION-}" ]; then
if [ -f "$HOME/.bashrc" ]; then
DETECTED_PROFILE="$HOME/.bashrc"
elif [ -f "$HOME/.bash_profile" ]; then
DETECTED_PROFILE="$HOME/.bash_profile"
fi
elif [ "${SHELL#*zsh}" != "$SHELL" ]; then
if [ -f "$HOME/.zshrc" ]; then
DETECTED_PROFILE="$HOME/.zshrc"
elif [ -f "$HOME/.zprofile" ]; then
DETECTED_PROFILE="$HOME/.zprofile"
fi
elif [ -n "${ZSH_VERSION-}" ]; then
DETECTED_PROFILE="$HOME/.zshrc"
fi
if [ -z "$DETECTED_PROFILE" ]; then
for EACH_PROFILE in ".profile" ".bashrc" ".bash_profile" ".zprofile" ".zshrc"
for EACH_PROFILE in ".profile" ".bashrc" ".bash_profile" ".zshrc"
do
if DETECTED_PROFILE="$(nvm_try_profile "${HOME}/${EACH_PROFILE}")"; then
break
@@ -313,7 +253,7 @@ nvm_detect_profile() {
fi
if [ -n "$DETECTED_PROFILE" ]; then
nvm_echo "$DETECTED_PROFILE"
echo "$DETECTED_PROFILE"
fi
}
@@ -322,9 +262,7 @@ nvm_detect_profile() {
# Node, and warn them if so.
#
nvm_check_global_modules() {
local NPM_COMMAND
NPM_COMMAND="$(command -v npm 2>/dev/null)" || return 0
[ -n "${NVM_DIR}" ] && [ -z "${NPM_COMMAND%%"$NVM_DIR"/*}" ] && return 0
command -v npm >/dev/null 2>&1 || return 0
local NPM_VERSION
NPM_VERSION="$(npm --version)"
@@ -346,76 +284,68 @@ nvm_check_global_modules() {
if [ "${MODULE_COUNT}" != '0' ]; then
# shellcheck disable=SC2016
nvm_echo '=> You currently have modules installed globally with `npm`. These will no'
echo '=> You currently have modules installed globally with `npm`. These will no'
# shellcheck disable=SC2016
nvm_echo '=> longer be linked to the active version of Node when you install a new node'
echo '=> longer be linked to the active version of Node when you install a new node'
# shellcheck disable=SC2016
nvm_echo '=> with `nvm`; and they may (depending on how you construct your `$PATH`)'
echo '=> with `nvm`; and they may (depending on how you construct your `$PATH`)'
# shellcheck disable=SC2016
nvm_echo '=> override the binaries of modules installed with `nvm`:'
nvm_echo
echo '=> override the binaries of modules installed with `nvm`:'
echo
command printf %s\\n "$NPM_GLOBAL_MODULES"
nvm_echo '=> If you wish to uninstall them at a later point (or re-install them under your'
echo '=> If you wish to uninstall them at a later point (or re-install them under your'
# shellcheck disable=SC2016
nvm_echo '=> `nvm` Nodes), you can remove them from the system Node as follows:'
nvm_echo
nvm_echo ' $ nvm use system'
nvm_echo ' $ npm uninstall -g a_module'
nvm_echo
echo '=> `nvm` Nodes), you can remove them from the system Node as follows:'
echo
echo ' $ nvm use system'
echo ' $ npm uninstall -g a_module'
echo
fi
}
nvm_do_install() {
if [ -n "${NVM_DIR-}" ] && ! [ -d "${NVM_DIR}" ]; then
if [ -e "${NVM_DIR}" ]; then
nvm_echo >&2 "File \"${NVM_DIR}\" has the same name as installation directory."
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."
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
fi
if [ -z "${METHOD}" ]; then
# Autodetect install method
if nvm_has git; then
install_nvm_from_git
elif nvm_has curl || nvm_has wget; then
elif nvm_has nvm_download; then
install_nvm_as_script
else
nvm_echo >&2 'You need git, curl, or wget to install nvm'
echo >&2 'You need git, curl, or wget to install nvm'
exit 1
fi
elif [ "${METHOD}" = 'git' ]; then
if ! nvm_has git; then
nvm_echo >&2 "You need git to install nvm"
echo >&2 "You need git to install nvm"
exit 1
fi
install_nvm_from_git
elif [ "${METHOD}" = 'script' ]; then
if ! nvm_has curl && ! nvm_has wget; then
nvm_echo >&2 "You need curl or wget to install nvm"
if ! nvm_has nvm_download; then
echo >&2 "You need curl or wget to install nvm"
exit 1
fi
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."
echo >&2 "The environment variable \$METHOD is set to \"${METHOD}\", which is not recognized as a valid installation method."
exit 1
fi
nvm_echo
echo
local NVM_PROFILE
NVM_PROFILE="$(nvm_detect_profile)"
@@ -433,32 +363,32 @@ nvm_do_install() {
if [ -n "${PROFILE}" ]; then
TRIED_PROFILE="${NVM_PROFILE} (as defined in \$PROFILE), "
fi
nvm_echo "=> Profile not found. Tried ${TRIED_PROFILE-}~/.bashrc, ~/.bash_profile, ~/.zprofile, ~/.zshrc, and ~/.profile."
nvm_echo "=> Create one of them and run this script again"
nvm_echo " OR"
nvm_echo "=> Append the following lines to the correct file yourself:"
echo "=> Profile not found. Tried ${TRIED_PROFILE-}~/.bashrc, ~/.bash_profile, ~/.zshrc, and ~/.profile."
echo "=> Create one of them and run this script again"
echo " OR"
echo "=> Append the following lines to the correct file yourself:"
command printf "${SOURCE_STR}"
nvm_echo
echo
else
if nvm_profile_is_bash_or_zsh "${NVM_PROFILE-}"; then
BASH_OR_ZSH=true
fi
if ! command grep -qc '/nvm.sh' "$NVM_PROFILE"; then
nvm_echo "=> Appending nvm source string to $NVM_PROFILE"
echo "=> Appending nvm source string to $NVM_PROFILE"
command printf "${SOURCE_STR}" >> "$NVM_PROFILE"
else
nvm_echo "=> nvm source string already in ${NVM_PROFILE}"
echo "=> nvm source string already in ${NVM_PROFILE}"
fi
# shellcheck disable=SC2016
if ${BASH_OR_ZSH} && ! command grep -qc '$NVM_DIR/bash_completion' "$NVM_PROFILE"; then
nvm_echo "=> Appending bash_completion source string to $NVM_PROFILE"
echo "=> Appending bash_completion source string to $NVM_PROFILE"
command printf "$COMPLETION_STR" >> "$NVM_PROFILE"
else
nvm_echo "=> bash_completion source string already in ${NVM_PROFILE}"
echo "=> bash_completion source string already in ${NVM_PROFILE}"
fi
fi
if ${BASH_OR_ZSH} && [ -z "${NVM_PROFILE-}" ] ; then
nvm_echo "=> Please also append the following lines to the if you are using bash/zsh shell:"
echo "=> Please also append the following lines to the if you are using bash/zsh shell:"
command printf "${COMPLETION_STR}"
fi
@@ -472,7 +402,7 @@ nvm_do_install() {
nvm_reset
nvm_echo "=> Close and reopen your terminal to start using nvm or run the following to use it now:"
echo "=> Close and reopen your terminal to start using nvm or run the following to use it now:"
command printf "${SOURCE_STR}"
if ${BASH_OR_ZSH} ; then
command printf "${COMPLETION_STR}"
@@ -487,7 +417,7 @@ nvm_reset() {
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 \
install_nvm_as_script nvm_try_profile nvm_detect_profile nvm_check_global_modules \
nvm_do_install nvm_reset nvm_default_install_dir nvm_grep
nvm_do_install nvm_reset nvm_default_install_dir
}
[ "_$NVM_ENV" = "_testing" ] || nvm_do_install

View File

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

1757
nvm.sh

File diff suppressed because it is too large Load Diff

View File

@@ -1,13 +1,13 @@
{
"name": "nvm",
"version": "0.39.7",
"version": "0.35.0",
"description": "Node Version Manager - Simple bash script to manage multiple active node.js versions",
"directories": {
"test": "test"
},
"scripts": {
"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/^-//'); env -i TERM=\"$TERM\" bash -lc \"make TEST_SUITE=fast test-$shell\"",
"test/fast": "shell=$(basename -- $(ps -o comm= $(ps -o ppid= -p $PPID)) | sed 's/^-//'); 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/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",
@@ -15,12 +15,8 @@
"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",
"doctoc": "doctoc --title='## Table of Contents' --github README.md",
"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"
"dockerfile_lint": "dockerfile_lint"
},
"repository": {
"type": "git",
@@ -40,12 +36,11 @@
},
"homepage": "https://github.com/nvm-sh/nvm",
"devDependencies": {
"dockerfile_lint": "^0.3.4",
"doctoc": "^2.2.1",
"eclint": "^2.8.1",
"markdown-link-check": "^3.11.2",
"replace": "^1.2.2",
"semver": "^7.5.4",
"urchin": "^0.0.5"
"dockerfile_lint": "^0.3.2",
"eclint": "^2.6.0",
"replace": "^0.3.0",
"semver": "^5.0.1",
"urchin": "^0.0.5",
"doctoc": "^1.2.0"
}
}

View File

@@ -1,52 +0,0 @@
#! /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

@@ -1,20 +0,0 @@
#!/bin/sh
die() { echo "$@" ; exit 1; }
export NVM_DIR="$(cd ../../.. && pwd)"
\. "${NVM_DIR}/nvm.sh"
\. ../../common.sh
echo "
v0.0.1
" > ../../../alias/test-blank-lines
EXPECTED='v0.0.1'
ACTUAL="$(nvm_alias test-blank-lines)"
EXIT_CODE="$(nvm_alias test-blank-lines 2>&1 >/dev/null; echo $?)"
[ "${ACTUAL}" = "${EXPECTED}" ] || die "expected >${EXPECTED}<, got >${ACTUAL}<"
[ "${EXIT_CODE}" = '0' ] || die "expected exit code 0, got ${EXIT_CODE}"

View File

@@ -1,17 +0,0 @@
#!/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

@@ -1,22 +0,0 @@
#!/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

@@ -1,31 +0,0 @@
#!/bin/sh
\. ../../../nvm.sh
die () {
echo "$@"
exit 1
}
set -e
MOCKS_DIR="../Unit tests/mocks"
# sample output at the time the test was written
TAB_PATH="$MOCKS_DIR/nodejs.org-dist-index.tab"
nvm_download() {
cat "$TAB_PATH"
}
nvm_alias_path() {
nvm_echo "../../../alias"
}
nvm ls-remote >/dev/null || die 'nvm ls-remote (to populate LTS aliases) failed'
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

@@ -1,21 +0,0 @@
#!/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

@@ -1,28 +0,0 @@
#!/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

@@ -1,21 +0,0 @@
#!/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

@@ -2,9 +2,7 @@
die () { echo "$@" ; exit 1; }
export NVM_DIR="$(cd ../../.. && pwd)"
\. "${NVM_DIR}/nvm.sh"
\. ../../../nvm.sh
EXIT_CODE=$(nvm_resolve_alias ; echo $?)
[ $EXIT_CODE = "1" ] || die "nvm_resolve_alias without an argument did not return 1; got $EXIT_CODE"
@@ -33,17 +31,3 @@ UNSTABLE="$(nvm_resolve_alias unstable)"
IOJS="$(nvm_resolve_alias iojs)"
[ "_$IOJS" = "_iojs-v0.2" ] || die "'nvm_resolve_alias iojs' was not iojs-v0.2; got $IOJS"
echo "
v0.0.1
v0.0.2
v0.0.3
" > ../../../alias/test-multi-lines
EXPECTED='v0.0.1'
ACTUAL="$(nvm_resolve_alias test-multi-lines)"
EXIT_CODE="$(nvm_resolve_alias test-multi-lines 2>&1 >/dev/null; echo $?)"
[ "${ACTUAL}" = "${EXPECTED}" ] || die "expected >${EXPECTED}<, got >${ACTUAL}<"
[ "${EXIT_CODE}" = '0' ] || die "expected exit code 0, got ${EXIT_CODE}"

View File

@@ -1,7 +1,5 @@
#!/bin/sh
export NVM_DIR="$(cd ../../.. && pwd)"
\. ../../../nvm.sh
\. ../../common.sh

View File

@@ -15,5 +15,3 @@ rm -f "../../../alias/unstable"
rm -f "../../../alias/node"
rm -f "../../../alias/iojs"
rm -f "../../../alias/default"
rm -f "../../../alias/test-blank-lines"
rm -f "../../../alias/test-multi-lines"

View File

@@ -1,42 +0,0 @@
#!/bin/zsh
export NVM_DIR="$(cd ../../.. && pwd)"
\. ../../../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

@@ -2,8 +2,6 @@
set -ex
export NVM_DIR="$(cd ../.. && pwd)"
\. ../../nvm.sh
nvm alias test v0.1.2

View File

@@ -4,8 +4,6 @@ set -ex
die () { echo "$@" ; exit 1; }
export NVM_DIR="$(cd ../.. && pwd)"
\. ../../nvm.sh
nvm deactivate 2>&1

View File

@@ -4,8 +4,6 @@ set -ex
die () { echo "$@" ; exit 1; }
export NVM_DIR="$(cd ../.. && pwd)"
\. ../../nvm.sh
\. ../common.sh

View File

@@ -7,8 +7,6 @@ cleanup () {
rm -rf "${NVM_DIR}/v0.10.4"
}
export NVM_DIR="$(cd ../.. && pwd)"
\. ../../nvm.sh
\. ../common.sh

View File

@@ -4,8 +4,6 @@ set -ex
die () { echo "$@" ; exit 1; }
export NVM_DIR="$(cd ../.. && pwd)"
\. ../../nvm.sh
set +ex # needed for stderr

View File

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

View File

@@ -27,9 +27,7 @@ EXPECTED_OUTPUT="$(nvm_add_iojs_prefix ${VERSION})"
nvm use --delete-prefix iojs || die '`nvm use iojs` failed'
# 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)"
CURRENT="$(nvm current)"
echo "current: ${CURRENT}"
[ "${CURRENT}" = "${IOJS_VERSION}" ] || die "expected >${IOJS_VERSION}<; got >${CURRENT}<"

View File

@@ -1,21 +0,0 @@
#!/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

@@ -1,19 +0,0 @@
#!/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

@@ -1,24 +0,0 @@
#!/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

@@ -1,52 +0,0 @@
#!/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

@@ -0,0 +1,17 @@
#!/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

@@ -1,9 +0,0 @@
iron
hydrogen
gallium
fermium
erbium
dubnium
carbon
boron
argon

View File

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

File diff suppressed because it is too large Load Diff

View File

@@ -58,14 +58,7 @@
v6.13.1  (LTS: Boron)
v6.14.0  (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)
v6.14.2  (Latest LTS: Boron)
v8.9.0  (LTS: Carbon)
v8.9.1  (LTS: Carbon)
v8.9.2  (LTS: Carbon)
@@ -74,139 +67,4 @@
v8.10.0  (LTS: Carbon)
v8.11.0  (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  (LTS: Fermium)
v14.21.0  (LTS: Fermium)
v14.21.1  (LTS: Fermium)
v14.21.2  (LTS: Fermium)
v14.21.3  (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  (LTS: Gallium)
v16.18.1  (LTS: Gallium)
v16.19.0  (LTS: Gallium)
v16.19.1  (LTS: Gallium)
v16.20.0  (LTS: Gallium)
v16.20.1  (LTS: Gallium)
v16.20.2  (Latest LTS: Gallium)
v18.12.0  (LTS: Hydrogen)
v18.12.1  (LTS: Hydrogen)
v18.13.0  (LTS: Hydrogen)
v18.14.0  (LTS: Hydrogen)
v18.14.1  (LTS: Hydrogen)
v18.14.2  (LTS: Hydrogen)
v18.15.0  (LTS: Hydrogen)
v18.16.0  (LTS: Hydrogen)
v18.16.1  (LTS: Hydrogen)
v18.17.0  (LTS: Hydrogen)
v18.17.1  (LTS: Hydrogen)
v18.18.0  (LTS: Hydrogen)
v18.18.1  (LTS: Hydrogen)
v18.18.2  (Latest LTS: Hydrogen)
v20.9.0  (Latest LTS: Iron)
v8.11.2  (Latest LTS: Carbon)

View File

@@ -331,14 +331,7 @@
v6.13.1  (LTS: Boron)
v6.14.0  (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)
v6.14.2  (Latest LTS: Boron)
v7.0.0
v7.1.0
v7.2.0
@@ -379,19 +372,7 @@
v8.10.0  (LTS: Carbon)
v8.11.0  (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)
v8.11.2  (Latest LTS: Carbon)
v9.0.0
v9.1.0
v9.2.0
@@ -409,303 +390,6 @@
v9.10.1
v9.11.0
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  (LTS: Fermium)
v14.21.0  (LTS: Fermium)
v14.21.1  (LTS: Fermium)
v14.21.2  (LTS: Fermium)
v14.21.3  (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  (LTS: Gallium)
v16.18.1  (LTS: Gallium)
v16.19.0  (LTS: Gallium)
v16.19.1  (LTS: Gallium)
v16.20.0  (LTS: Gallium)
v16.20.1  (LTS: Gallium)
v16.20.2  (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
v18.11.0
v18.12.0  (LTS: Hydrogen)
v18.12.1  (LTS: Hydrogen)
v18.13.0  (LTS: Hydrogen)
v18.14.0  (LTS: Hydrogen)
v18.14.1  (LTS: Hydrogen)
v18.14.2  (LTS: Hydrogen)
v18.15.0  (LTS: Hydrogen)
v18.16.0  (LTS: Hydrogen)
v18.16.1  (LTS: Hydrogen)
v18.17.0  (LTS: Hydrogen)
v18.17.1  (LTS: Hydrogen)
v18.18.0  (LTS: Hydrogen)
v18.18.1  (LTS: Hydrogen)
v18.18.2  (Latest LTS: Hydrogen)
v19.0.0
v19.0.1
v19.1.0
v19.2.0
v19.3.0
v19.4.0
v19.5.0
v19.6.0
v19.6.1
v19.7.0
v19.8.0
v19.8.1
v19.9.0
v20.0.0
v20.1.0
v20.2.0
v20.3.0
v20.3.1
v20.4.0
v20.5.0
v20.5.1
v20.6.0
v20.6.1
v20.7.0
v20.8.0
v20.8.1
v20.9.0  (Latest LTS: Iron)
v21.0.0
v21.1.0

View File

@@ -372,14 +372,7 @@
v6.13.1  (LTS: Boron)
v6.14.0  (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)
v6.14.2  (Latest LTS: Boron)
v7.0.0
v7.1.0
v7.2.0
@@ -420,19 +413,7 @@
v8.10.0  (LTS: Carbon)
v8.11.0  (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)
v8.11.2  (Latest LTS: Carbon)
v9.0.0
v9.1.0
v9.2.0
@@ -450,303 +431,6 @@
v9.10.1
v9.11.0
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  (LTS: Fermium)
v14.21.0  (LTS: Fermium)
v14.21.1  (LTS: Fermium)
v14.21.2  (LTS: Fermium)
v14.21.3  (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  (LTS: Gallium)
v16.18.1  (LTS: Gallium)
v16.19.0  (LTS: Gallium)
v16.19.1  (LTS: Gallium)
v16.20.0  (LTS: Gallium)
v16.20.1  (LTS: Gallium)
v16.20.2  (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
v18.11.0
v18.12.0  (LTS: Hydrogen)
v18.12.1  (LTS: Hydrogen)
v18.13.0  (LTS: Hydrogen)
v18.14.0  (LTS: Hydrogen)
v18.14.1  (LTS: Hydrogen)
v18.14.2  (LTS: Hydrogen)
v18.15.0  (LTS: Hydrogen)
v18.16.0  (LTS: Hydrogen)
v18.16.1  (LTS: Hydrogen)
v18.17.0  (LTS: Hydrogen)
v18.17.1  (LTS: Hydrogen)
v18.18.0  (LTS: Hydrogen)
v18.18.1  (LTS: Hydrogen)
v18.18.2  (Latest LTS: Hydrogen)
v19.0.0
v19.0.1
v19.1.0
v19.2.0
v19.3.0
v19.4.0
v19.5.0
v19.6.0
v19.6.1
v19.7.0
v19.8.0
v19.8.1
v19.9.0
v20.0.0
v20.1.0
v20.2.0
v20.3.0
v20.3.1
v20.4.0
v20.5.0
v20.5.1
v20.6.0
v20.6.1
v20.7.0
v20.8.0
v20.8.1
v20.9.0  (Latest LTS: Iron)
v21.0.0
v21.1.0

View File

@@ -33,4 +33,4 @@ v4.8.5 Argon
v4.8.6 Argon
v4.8.7 Argon
v4.9.0 Argon
v4.9.1 Argon *
v4.9.1 Argon

View File

@@ -1,6 +1,12 @@
v6.9.6-nightly201702013f61aae59d Boron *
v8.9.1-nightly20171104a815e1b6a2 Carbon *
v10.15.3-nightly20190301156e4c8e89 Dubnium
v10.15.4-nightly201905019101d9368f Dubnium
v10.16.2-nightly20190801f025f8524b Dubnium *
v12.22.10-nightly2022012660c9d3bb95 Erbium *
v6.9.1-nightly201610183843b96e46 Boron
v6.9.2-nightly201610208bb346d61a Boron
v6.9.3-nightly20161206c350268432 Boron
v6.9.4-nightly201701049844692719 Boron
v6.9.5-nightly2017013187ac44974a Boron
v6.9.6-nightly201702013f61aae59d Boron
v6.10.1-nightly20170222ee10f21f3b Boron
v6.10.2-nightly20170322426968ddd8 Boron
v6.10.3-nightly2017040479546c0b5a Boron
v6.10.4-nightly20170502312091a196 Boron
v6.11.1-nightly20170607f7ca483d68 Boron
v8.9.1-nightly20171104a815e1b6a2 Carbon

View File

@@ -33,7 +33,7 @@ v4.8.5 Argon
v4.8.6 Argon
v4.8.7 Argon
v4.9.0 Argon
v4.9.1 Argon *
v4.9.1 Argon
v6.9.0 Boron
v6.9.1 Boron
v6.9.2 Boron
@@ -59,13 +59,6 @@ v6.13.1 Boron
v6.14.0 Boron
v6.14.1 Boron
v6.14.2 Boron
v6.14.3 Boron
v6.14.4 Boron
v6.15.0 Boron
v6.15.1 Boron
v6.16.0 Boron
v6.17.0 Boron
v6.17.1 Boron *
v8.9.0 Carbon
v8.9.1 Carbon
v8.9.2 Carbon
@@ -75,138 +68,3 @@ v8.10.0 Carbon
v8.11.0 Carbon
v8.11.1 Carbon
v8.11.2 Carbon
v8.11.3 Carbon
v8.11.4 Carbon
v8.12.0 Carbon
v8.13.0 Carbon
v8.14.0 Carbon
v8.14.1 Carbon
v8.15.0 Carbon
v8.15.1 Carbon
v8.16.0 Carbon
v8.16.1 Carbon
v8.16.2 Carbon
v8.17.0 Carbon *
v10.13.0 Dubnium
v10.14.0 Dubnium
v10.14.1 Dubnium
v10.14.2 Dubnium
v10.15.0 Dubnium
v10.15.1 Dubnium
v10.15.2 Dubnium
v10.15.3 Dubnium
v10.16.0 Dubnium
v10.16.1 Dubnium
v10.16.2 Dubnium
v10.16.3 Dubnium
v10.17.0 Dubnium
v10.18.0 Dubnium
v10.18.1 Dubnium
v10.19.0 Dubnium
v10.20.0 Dubnium
v10.20.1 Dubnium
v10.21.0 Dubnium
v10.22.0 Dubnium
v10.22.1 Dubnium
v10.23.0 Dubnium
v10.23.1 Dubnium
v10.23.2 Dubnium
v10.23.3 Dubnium
v10.24.0 Dubnium
v10.24.1 Dubnium *
v12.13.0 Erbium
v12.13.1 Erbium
v12.14.0 Erbium
v12.14.1 Erbium
v12.15.0 Erbium
v12.16.0 Erbium
v12.16.1 Erbium
v12.16.2 Erbium
v12.16.3 Erbium
v12.17.0 Erbium
v12.18.0 Erbium
v12.18.1 Erbium
v12.18.2 Erbium
v12.18.3 Erbium
v12.18.4 Erbium
v12.19.0 Erbium
v12.19.1 Erbium
v12.20.0 Erbium
v12.20.1 Erbium
v12.20.2 Erbium
v12.21.0 Erbium
v12.22.0 Erbium
v12.22.1 Erbium
v12.22.2 Erbium
v12.22.3 Erbium
v12.22.4 Erbium
v12.22.5 Erbium
v12.22.6 Erbium
v12.22.7 Erbium
v12.22.8 Erbium
v12.22.9 Erbium
v12.22.10 Erbium
v12.22.11 Erbium
v12.22.12 Erbium *
v14.15.0 Fermium
v14.15.1 Fermium
v14.15.2 Fermium
v14.15.3 Fermium
v14.15.4 Fermium
v14.15.5 Fermium
v14.16.0 Fermium
v14.16.1 Fermium
v14.17.0 Fermium
v14.17.1 Fermium
v14.17.2 Fermium
v14.17.3 Fermium
v14.17.4 Fermium
v14.17.5 Fermium
v14.17.6 Fermium
v14.18.0 Fermium
v14.18.1 Fermium
v14.18.2 Fermium
v14.18.3 Fermium
v14.19.0 Fermium
v14.19.1 Fermium
v14.19.2 Fermium
v14.19.3 Fermium
v14.20.0 Fermium
v14.20.1 Fermium
v14.21.0 Fermium
v14.21.1 Fermium
v14.21.2 Fermium
v14.21.3 Fermium *
v16.13.0 Gallium
v16.13.1 Gallium
v16.13.2 Gallium
v16.14.0 Gallium
v16.14.1 Gallium
v16.14.2 Gallium
v16.15.0 Gallium
v16.15.1 Gallium
v16.16.0 Gallium
v16.17.0 Gallium
v16.17.1 Gallium
v16.18.0 Gallium
v16.18.1 Gallium
v16.19.0 Gallium
v16.19.1 Gallium
v16.20.0 Gallium
v16.20.1 Gallium
v16.20.2 Gallium *
v18.12.0 Hydrogen
v18.12.1 Hydrogen
v18.13.0 Hydrogen
v18.14.0 Hydrogen
v18.14.1 Hydrogen
v18.14.2 Hydrogen
v18.15.0 Hydrogen
v18.16.0 Hydrogen
v18.16.1 Hydrogen
v18.17.0 Hydrogen
v18.17.1 Hydrogen
v18.18.0 Hydrogen
v18.18.1 Hydrogen
v18.18.2 Hydrogen *
v20.9.0 Iron *

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