From 216ccd62f707eeee5ba188bd668f2414a58e6593 Mon Sep 17 00:00:00 2001 From: artforlife Date: Sun, 26 Apr 2020 12:57:50 -0500 Subject: [PATCH 01/10] [readme] add commands to help troubleshoot without closing the current shell Co-authored-by: artforlife Co-authored-by: Sladyn Nunes --- README.md | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c41d0f8..5d45ea8 100644 --- a/README.md +++ b/README.md @@ -89,6 +89,15 @@ Eg: `curl ... | NVM_DIR="path/to/nvm"`. Ensure that the `NVM_DIR` does not conta #### Troubleshooting on Linux 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 run the following commands for the different shells on the command line: + +*bash*: `source ~/.bashrc` + +*zsh*: `source ~/.zhrc` + +*ksh*: `. ~/.profile` + +These should pick up the `nvm` command. #### Troubleshooting on macOS @@ -98,11 +107,13 @@ If you get `nvm: command not found` after running the install script, one of the - 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, run `touch ~/.bash_profile` to create the necessary profile file if it does not exist. + - If you use bash, the previous default shell, 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. Then, run `source ~/.bash_profile` 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. - - You have previously used `bash`, but you have `zsh` installed. You need to manually add [these lines](#manual-install) to `~/.zshrc` and run `. ~/.zshrc`. + - If the above didn't help, you might need to restart your terminal instance. Try opening a new tab/window in your terminal and retry. If the above doesn't fix the problem, you may try the following: From 9cb6a2b614c01e83611d704501d9a3ba5af7b8a3 Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Wed, 17 Mar 2021 08:11:37 -0700 Subject: [PATCH 02/10] [Tests] ensure `doctoc` action fails when it should --- .github/workflows/lint.yml | 8 ++------ package.json | 3 +++ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 26c7e88..67d32ee 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -28,14 +28,10 @@ jobs: steps: - uses: actions/checkout@v2 - uses: ljharb/actions/node/run@main - name: 'npm install && npm run dockerfile_lint' + name: 'npm install && npm run doctoc' with: node-version: 'lts/*' - shell-command: | - set -e - cp README.md README.md.orig - npm run doctoc - diff -q README.md README.md.orig + command: "doctoc:check" test_naming: runs-on: ubuntu-latest diff --git a/package.json b/package.json index f520f7e..09834e4 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,9 @@ "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" }, From 25d2ebf2f8acbdcd6ff7d2b1eddd699a21ae6708 Mon Sep 17 00:00:00 2001 From: Sladyn Nunes Date: Wed, 3 Mar 2021 20:47:44 +0530 Subject: [PATCH 03/10] [readme] add headings to certain sections Fixes #2413. --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 5d45ea8..a50bf32 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,9 @@ - [Setting Custom Colors](#setting-custom-colors) - [Persisting custom colors](#persisting-custom-colors) - [Suppressing colorized output](#suppressing-colorized-output) + - [Restoring PATH](#restoring-path) + - [Set default node version](#set-default-node-version) + - [Use a mirror of node binaries](#use-a-mirror-of-node-binaries) - [.nvmrc](#nvmrc) - [Deeper Shell Integration](#deeper-shell-integration) - [bash](#bash) @@ -440,18 +443,21 @@ 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 ``` +#### Use a mirror of node binaries To use a mirror of the node binaries, set `$NVM_NODEJS_ORG_MIRROR`: ```sh From 8884fd32f65054778bcad35fbcdf3c8a0ea30347 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20K=C5=82opotek?= Date: Mon, 1 Mar 2021 13:28:09 +0100 Subject: [PATCH 04/10] [readme] Add `nvs` as one of the Windows alternatives Co-authored-by: Jordan Harband --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a50bf32..d71fa94 100644 --- a/README.md +++ b/README.md @@ -152,10 +152,11 @@ which should output `nvm` if the installation was successful. Please note that ` If you're running a system without prepackaged binary available, which means you're going to install nodejs or io.js from its source code, you need to make sure your system has a C++ compiler. For OS X, Xcode will work, for Debian/Ubuntu based GNU/Linux, the `build-essential` and `libssl-dev` packages work. -**Note:** `nvm` does not support Windows (see [#284](https://github.com/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: +**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, a few 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: From 05797183085d9ec77793321fcce8562974ba290c Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Wed, 17 Mar 2021 09:07:15 -0700 Subject: [PATCH 05/10] [Fix] install script: define `nvm_echo` - refactor `echo` to use `nvm_echo` Per https://github.com/nvm-sh/nvm/commit/589c2377fbe37c23996a82d6d88b37c62f1a022a#r48360520 --- install.sh | 118 +++++++++++++++++++++++++++-------------------------- 1 file changed, 61 insertions(+), 57 deletions(-) diff --git a/install.sh b/install.sh index 3bcb6f0..8ab535f 100755 --- a/install.sh +++ b/install.sh @@ -6,6 +6,10 @@ nvm_has() { type "$1" > /dev/null 2>&1 } +nvm_echo() { + command printf %s\\n "$*" 2>/dev/null +} + nvm_grep() { GREP_OPTIONS='' command grep "$@" } @@ -23,7 +27,7 @@ nvm_install_dir() { } nvm_latest_version() { - echo "v0.37.2" + nvm_echo "v0.37.2" } nvm_profile_is_bash_or_zsh() { @@ -64,18 +68,18 @@ nvm_source() { elif [ "_$NVM_METHOD" = "_git" ] || [ -z "$NVM_METHOD" ]; then NVM_SOURCE_URL="https://github.com/${NVM_GITHUB_REPO}.git" else - echo >&2 "Unexpected value \"$NVM_METHOD\" for \$NVM_METHOD" + nvm_echo >&2 "Unexpected value \"$NVM_METHOD\" for \$NVM_METHOD" return 1 fi fi - echo "$NVM_SOURCE_URL" + nvm_echo "$NVM_SOURCE_URL" } # # Node.js version to install # nvm_node_version() { - echo "$NODE_VERSION" + nvm_echo "$NODE_VERSION" } nvm_download() { @@ -108,7 +112,7 @@ install_nvm_from_git() { : # Check if version is an existing changeset elif ! nvm_download -o /dev/null "$(nvm_source "script-nvm-exec")"; then - echo >&2 "Failed to find '$NVM_VERSION' version." + nvm_echo >&2 "Failed to find '$NVM_VERSION' version." exit 1 fi fi @@ -116,29 +120,29 @@ install_nvm_from_git() { local fetch_error if [ -d "$INSTALL_DIR/.git" ]; then # Updating repo - echo "=> nvm is already installed in $INSTALL_DIR, trying to update using git" + nvm_echo "=> nvm is already installed in $INSTALL_DIR, trying to update using git" command printf '\r=> ' fetch_error="Failed to update nvm with $NVM_VERSION, run 'git fetch' in $INSTALL_DIR yourself." else fetch_error="Failed to fetch origin with $NVM_VERSION. Please report this!" - echo "=> Downloading nvm from git to '$INSTALL_DIR'" + nvm_echo "=> Downloading nvm from git to '$INSTALL_DIR'" command printf '\r=> ' mkdir -p "${INSTALL_DIR}" if [ "$(ls -A "${INSTALL_DIR}")" ]; then # Initializing repo command git init "${INSTALL_DIR}" || { - echo >&2 'Failed to initialize nvm repo. Please report this!' + nvm_echo >&2 'Failed to initialize nvm repo. Please report this!' exit 2 } 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)" || { - echo >&2 'Failed to add remote "origin" (or set the URL). Please report this!' + nvm_echo >&2 'Failed to add remote "origin" (or set the URL). Please report this!' exit 2 } else # Cloning repo command git clone "$(nvm_source)" --depth=1 "${INSTALL_DIR}" || { - echo >&2 'Failed to clone nvm repo. Please report this!' + nvm_echo >&2 'Failed to clone nvm repo. Please report this!' exit 2 } fi @@ -148,28 +152,28 @@ install_nvm_from_git() { : # Fetch given version elif ! command git --git-dir="$INSTALL_DIR"/.git --work-tree="$INSTALL_DIR" fetch origin "$NVM_VERSION" --depth=1; then - echo >&2 "$fetch_error" + 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 || { - echo >&2 "Failed to checkout the given version $NVM_VERSION. Please report this!" + nvm_echo >&2 "Failed to checkout the given version $NVM_VERSION. Please report this!" exit 2 } if [ -n "$(command git --git-dir="$INSTALL_DIR"/.git --work-tree="$INSTALL_DIR" show-ref refs/heads/master)" ]; then if command git --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 - echo >&2 "Your version of git is out of date. Please update it!" + nvm_echo >&2 "Your version of git is out of date. Please update it!" command git --git-dir="$INSTALL_DIR"/.git --work-tree="$INSTALL_DIR" branch -D master >/dev/null 2>&1 fi fi - echo "=> Compressing and cleaning up git repository" + nvm_echo "=> Compressing and cleaning up git repository" if ! command git --git-dir="$INSTALL_DIR"/.git --work-tree="$INSTALL_DIR" reflog expire --expire=now --all; then - echo >&2 "Your version of git is out of date. Please update it!" + nvm_echo >&2 "Your version of git is out of date. Please update it!" fi if ! command git --git-dir="$INSTALL_DIR"/.git --work-tree="$INSTALL_DIR" gc --auto --aggressive --prune=now ; then - echo >&2 "Your version of git is out of date. Please update it!" + nvm_echo >&2 "Your version of git is out of date. Please update it!" fi return } @@ -185,15 +189,15 @@ nvm_install_node() { return 0 fi - echo "=> Installing Node.js version $NODE_VERSION_LOCAL" + nvm_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 - echo "=> Node.js version $NODE_VERSION_LOCAL has been successfully installed" + nvm_echo "=> Node.js version $NODE_VERSION_LOCAL has been successfully installed" else - echo >&2 "Failed to install Node.js $NODE_VERSION_LOCAL" + nvm_echo >&2 "Failed to install Node.js $NODE_VERSION_LOCAL" fi } @@ -210,20 +214,20 @@ install_nvm_as_script() { # Downloading to $INSTALL_DIR mkdir -p "$INSTALL_DIR" if [ -f "$INSTALL_DIR/nvm.sh" ]; then - echo "=> nvm is already installed in $INSTALL_DIR, trying to update the script" + nvm_echo "=> nvm is already installed in $INSTALL_DIR, trying to update the script" else - echo "=> Downloading nvm as script to '$INSTALL_DIR'" + nvm_echo "=> Downloading nvm as script to '$INSTALL_DIR'" fi nvm_download -s "$NVM_SOURCE_LOCAL" -o "$INSTALL_DIR/nvm.sh" || { - echo >&2 "Failed to download '$NVM_SOURCE_LOCAL'" + nvm_echo >&2 "Failed to download '$NVM_SOURCE_LOCAL'" return 1 } & nvm_download -s "$NVM_EXEC_SOURCE" -o "$INSTALL_DIR/nvm-exec" || { - echo >&2 "Failed to download '$NVM_EXEC_SOURCE'" + nvm_echo >&2 "Failed to download '$NVM_EXEC_SOURCE'" return 2 } & nvm_download -s "$NVM_BASH_COMPLETION_SOURCE" -o "$INSTALL_DIR/bash_completion" || { - echo >&2 "Failed to download '$NVM_BASH_COMPLETION_SOURCE'" + nvm_echo >&2 "Failed to download '$NVM_BASH_COMPLETION_SOURCE'" return 2 } & for job in $(jobs -p | command sort) @@ -231,7 +235,7 @@ install_nvm_as_script() { wait "$job" || return $? done chmod a+x "$INSTALL_DIR/nvm-exec" || { - echo >&2 "Failed to mark '$INSTALL_DIR/nvm-exec' as executable" + nvm_echo >&2 "Failed to mark '$INSTALL_DIR/nvm-exec' as executable" return 3 } } @@ -240,7 +244,7 @@ nvm_try_profile() { if [ -z "${1-}" ] || [ ! -f "${1}" ]; then return 1 fi - echo "${1}" + nvm_echo "${1}" } # @@ -256,7 +260,7 @@ nvm_detect_profile() { fi if [ -n "${PROFILE}" ] && [ -f "${PROFILE}" ]; then - echo "${PROFILE}" + nvm_echo "${PROFILE}" return fi @@ -283,7 +287,7 @@ nvm_detect_profile() { fi if [ -n "$DETECTED_PROFILE" ]; then - echo "$DETECTED_PROFILE" + nvm_echo "$DETECTED_PROFILE" fi } @@ -316,37 +320,37 @@ nvm_check_global_modules() { if [ "${MODULE_COUNT}" != '0' ]; then # shellcheck disable=SC2016 - echo '=> You currently have modules installed globally with `npm`. These will no' + nvm_echo '=> You currently have modules installed globally with `npm`. These will no' # shellcheck disable=SC2016 - echo '=> longer be linked to the active version of Node when you install a new node' + nvm_echo '=> longer be linked to the active version of Node when you install a new node' # shellcheck disable=SC2016 - echo '=> with `nvm`; and they may (depending on how you construct your `$PATH`)' + nvm_echo '=> with `nvm`; and they may (depending on how you construct your `$PATH`)' # shellcheck disable=SC2016 - echo '=> override the binaries of modules installed with `nvm`:' - echo + nvm_echo '=> override the binaries of modules installed with `nvm`:' + nvm_echo command printf %s\\n "$NPM_GLOBAL_MODULES" - echo '=> If you wish to uninstall them at a later point (or re-install them under your' + nvm_echo '=> If you wish to uninstall them at a later point (or re-install them under your' # shellcheck disable=SC2016 - 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 + 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 fi } nvm_do_install() { if [ -n "${NVM_DIR-}" ] && ! [ -d "${NVM_DIR}" ]; then if [ -e "${NVM_DIR}" ]; then - echo >&2 "File \"${NVM_DIR}\" has the same name as installation directory." + nvm_echo >&2 "File \"${NVM_DIR}\" has the same name as installation directory." exit 1 fi if [ "${NVM_DIR}" = "$(nvm_default_install_dir)" ]; then mkdir "${NVM_DIR}" else - echo >&2 "You have \$NVM_DIR set to \"${NVM_DIR}\", but that directory does not exist. Check your profile files and environment." + nvm_echo >&2 "You have \$NVM_DIR set to \"${NVM_DIR}\", but that directory does not exist. Check your profile files and environment." exit 1 fi fi @@ -357,27 +361,27 @@ nvm_do_install() { elif nvm_has nvm_download; then install_nvm_as_script else - echo >&2 'You need git, curl, or wget to install nvm' + nvm_echo >&2 'You need git, curl, or wget to install nvm' exit 1 fi elif [ "${METHOD}" = 'git' ]; then if ! nvm_has git; then - echo >&2 "You need git to install nvm" + nvm_echo >&2 "You need git to install nvm" exit 1 fi install_nvm_from_git elif [ "${METHOD}" = 'script' ]; then if ! nvm_has nvm_download; then - echo >&2 "You need curl or wget to install nvm" + nvm_echo >&2 "You need curl or wget to install nvm" exit 1 fi install_nvm_as_script else - echo >&2 "The environment variable \$METHOD is set to \"${METHOD}\", which is not recognized as a valid installation method." + nvm_echo >&2 "The environment variable \$METHOD is set to \"${METHOD}\", which is not recognized as a valid installation method." exit 1 fi - echo + nvm_echo local NVM_PROFILE NVM_PROFILE="$(nvm_detect_profile)" @@ -395,32 +399,32 @@ nvm_do_install() { if [ -n "${PROFILE}" ]; then TRIED_PROFILE="${NVM_PROFILE} (as defined in \$PROFILE), " fi - 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:" + nvm_echo "=> Profile not found. Tried ${TRIED_PROFILE-}~/.bashrc, ~/.bash_profile, ~/.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:" command printf "${SOURCE_STR}" - echo + nvm_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 - echo "=> Appending nvm source string to $NVM_PROFILE" + nvm_echo "=> Appending nvm source string to $NVM_PROFILE" command printf "${SOURCE_STR}" >> "$NVM_PROFILE" else - echo "=> nvm source string already in ${NVM_PROFILE}" + nvm_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 - echo "=> Appending bash_completion source string to $NVM_PROFILE" + nvm_echo "=> Appending bash_completion source string to $NVM_PROFILE" command printf "$COMPLETION_STR" >> "$NVM_PROFILE" else - echo "=> bash_completion source string already in ${NVM_PROFILE}" + nvm_echo "=> bash_completion source string already in ${NVM_PROFILE}" fi fi if ${BASH_OR_ZSH} && [ -z "${NVM_PROFILE-}" ] ; then - echo "=> Please also append the following lines to the if you are using bash/zsh shell:" + nvm_echo "=> Please also append the following lines to the if you are using bash/zsh shell:" command printf "${COMPLETION_STR}" fi @@ -434,7 +438,7 @@ nvm_do_install() { nvm_reset - echo "=> Close and reopen your terminal to start using nvm or run the following to use it now:" + nvm_echo "=> Close and reopen your terminal to start using nvm or run the following to use it now:" command printf "${SOURCE_STR}" if ${BASH_OR_ZSH} ; then command printf "${COMPLETION_STR}" From b19d8dbbba078680cafa0feb85194dd3a7420929 Mon Sep 17 00:00:00 2001 From: Andrew Shield Date: Thu, 18 Mar 2021 16:07:24 +1300 Subject: [PATCH 06/10] [readme] Update source command to include s in zsh --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d71fa94..b60a8c2 100644 --- a/README.md +++ b/README.md @@ -96,7 +96,7 @@ Alternatively, you can run run the following commands for the different shells o *bash*: `source ~/.bashrc` -*zsh*: `source ~/.zhrc` +*zsh*: `source ~/.zshrc` *ksh*: `. ~/.profile` From 621ccc5d13c5c8ca6cb49d3a6fd1b77b575d3c9f Mon Sep 17 00:00:00 2001 From: Jonathan Perret Date: Tue, 23 Mar 2021 14:37:04 +0100 Subject: [PATCH 07/10] Clarify the M1 shell instructions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The instructions seemed to encourage the misconception that `arch -x86_64 zsh` somehow modifies the default architecture for `zsh`, an operation which would need to be "reverted". In fact, `arch -x86_64 …` merely spawns a new process under the selected architecture. --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b60a8c2..8f6caec 100644 --- a/README.md +++ b/README.md @@ -919,13 +919,13 @@ arm64 $ nvm install v12.20.1 # Now uninstall the version we want to replace: $ nvm uninstall v14.15.4 -# Set the architecture for our shell to 64-bit X86: +# Launch a new zsh process under the 64-bit X86 architecture: $ arch -x86_64 zsh # Install node using nvm. This should download the precompiled x64 binary: $ nvm install v14.15.4 # Now check that the architecture is correct: $ node -p process.arch x64 -# It is now safe to revert zsh back to the native architecture: -$ arch -arm64 zsh +# It is now safe to return to the arm64 zsh process: +$ exit ``` From c26bd935c0cd9574035d5bde8ed930e6a4d8b16b Mon Sep 17 00:00:00 2001 From: Jonathan Perret Date: Wed, 24 Mar 2021 10:50:38 +0100 Subject: [PATCH 08/10] [readme] M1 macs: Add `nvm use` command to clarify that it is required --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 8f6caec..564fbc4 100644 --- a/README.md +++ b/README.md @@ -928,4 +928,10 @@ $ node -p process.arch x64 # It is now safe to return to the arm64 zsh process: $ exit +# We're back to a native shell: +$ arch +arm64 +# And the new version is now available to use: +$ nvm use v14.15.4 +Now using node v14.15.4 (npm v6.14.10) ``` From cfc7edac65d1c3fbc94567dbf347b1166628a0d6 Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Mon, 29 Mar 2021 12:49:02 -0700 Subject: [PATCH 09/10] [Dev Deps] update `dockerfile_lint`, `eclint`, `replace`, `semver` --- package.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 09834e4..eec13f5 100644 --- a/package.json +++ b/package.json @@ -39,11 +39,11 @@ }, "homepage": "https://github.com/nvm-sh/nvm", "devDependencies": { - "dockerfile_lint": "^0.3.2", + "dockerfile_lint": "^0.3.4", "doctoc": "^2.0.0", - "eclint": "^2.6.0", - "replace": "^1.2.0", - "semver": "^7.3.4", + "eclint": "^2.8.1", + "replace": "^1.2.1", + "semver": "^7.3.5", "urchin": "^0.0.5" } } From 3fea5493a431ac64470d4230d4b51438cf213bd1 Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Mon, 29 Mar 2021 12:49:10 -0700 Subject: [PATCH 10/10] v0.38.0 --- README.md | 16 ++++++++-------- install.sh | 2 +- nvm.sh | 2 +- package.json | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 564fbc4..b43a699 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# 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.37.2-yellow.svg)][4] [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/684/badge)](https://bestpractices.coreinfrastructure.org/projects/684) +# 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.38.0-yellow.svg)][4] [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/684/badge)](https://bestpractices.coreinfrastructure.org/projects/684) @@ -64,10 +64,10 @@ nvm is a version manager for [node.js](https://nodejs.org/en/), designed to be i 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.37.2/install.sh | bash +curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash ``` ```sh -wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bash +wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.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`). @@ -133,7 +133,7 @@ You can use a task: ```yaml - name: nvm shell: > - curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bash + curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash args: creates: "{{ ansible_env.HOME }}/.nvm/nvm.sh" ``` @@ -193,7 +193,7 @@ 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.37.2` +1. `cd ~/.nvm` and check out the latest version with `git checkout v0.38.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: @@ -772,7 +772,7 @@ If installing nvm on Alpine Linux *is* still what you want or need to do, you sh ```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.37.2/install.sh | bash +curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash ``` The Node project has some desire but no concrete plans (due to the overheads of building, testing and support) to offer Alpine-compatible binaries. @@ -869,9 +869,9 @@ You have to make sure that the user directory name in `$HOME` and the user direc 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.37.2/install.sh +[2]: https://github.com/nvm-sh/nvm/blob/v0.38.0/install.sh [3]: https://travis-ci.org/nvm-sh/nvm -[4]: https://github.com/nvm-sh/nvm/releases/tag/v0.37.2 +[4]: https://github.com/nvm-sh/nvm/releases/tag/v0.38.0 [Urchin]: https://github.com/scraperwiki/urchin [Fish]: http://fishshell.com diff --git a/install.sh b/install.sh index 8ab535f..50fbd3a 100755 --- a/install.sh +++ b/install.sh @@ -27,7 +27,7 @@ nvm_install_dir() { } nvm_latest_version() { - nvm_echo "v0.37.2" + nvm_echo "v0.38.0" } nvm_profile_is_bash_or_zsh() { diff --git a/nvm.sh b/nvm.sh index 574b8f3..edf964a 100644 --- a/nvm.sh +++ b/nvm.sh @@ -3971,7 +3971,7 @@ nvm() { NVM_VERSION_ONLY=true NVM_LTS="${NVM_LTS-}" nvm_remote_version "${PATTERN:-node}" ;; "--version" | "-v") - nvm_echo '0.37.2' + nvm_echo '0.38.0' ;; "unload") nvm deactivate >/dev/null 2>&1 diff --git a/package.json b/package.json index eec13f5..2387b2f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "nvm", - "version": "0.37.2", + "version": "0.38.0", "description": "Node Version Manager - Simple bash script to manage multiple active node.js versions", "directories": { "test": "test"