Compare commits

..

3 Commits

Author SHA1 Message Date
Jordan Harband
76c61c9845 [actions] migrate Travis CI tests to GitHub Actions
Some checks failed
Tests on Windows: `nvm install` / WSL nvm install (script, 12, Debian) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (script, 12, Ubuntu-18.04) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (script, 12, Ubuntu-20.04) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (script, 14, Debian) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (script, 14, Ubuntu-18.04) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (script, 14, Ubuntu-20.04) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (script, 16, Debian) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (script, 16, Ubuntu-18.04) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (script, 16, Ubuntu-20.04) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (script, 18, Debian) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (script, 18, Ubuntu-20.04) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (script, 21, Debian) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (script, 21, Ubuntu-20.04) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (, --lts, Alpine) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (, 10, Alpine) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (, 11, Alpine) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (, 12, Alpine) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (, 14, Alpine) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (, 16, Alpine) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (, 18, Alpine) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (, 21, Alpine) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (script, --lts, Alpine) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (script, 10, Alpine) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (script, 11, Alpine) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (script, 12, Alpine) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (script, 14, Alpine) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (script, 16, Alpine) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (script, 18, Alpine) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (script, 21, Alpine) (push) Has been cancelled
Tests on Windows: `nvm install` / tests, on windows (push) Has been cancelled
2026-01-26 17:01:08 -08:00
Jordan Harband
3c7a5654f5 [Fix] nvm_get_default_packages: use portable awk patterns
Replace POSIX `[[:space:]]` character class with `[ \t]` for
mawk compatibility on Ubuntu 16.04.
2026-01-26 16:59:11 -08:00
Jordan Harband
7346ee6523 [Fix] nvm_install_source: explicitly set SHELL=/bin/sh for make
Old Node.js versions have Makefiles with unquoted glob patterns like
`rm -f *.o` that fail in zsh's strict glob mode. By passing
SHELL=/bin/sh to make, we ensure POSIX-compliant shell behavior
regardless of what shell nvm is running in.
2026-01-26 15:07:01 -08:00
8 changed files with 240 additions and 52 deletions

View File

@@ -10,7 +10,7 @@ jobs:
permissions:
contents: read
name: 'fast (${{ matrix.shell }})'
name: 'fast (${{ matrix.shell }}, ${{ matrix.awk }})'
runs-on: ubuntu-latest
defaults:
run:
@@ -25,6 +25,9 @@ jobs:
- dash
- zsh
# - ksh
awk:
- gawk
- mawk
steps:
- name: Harden Runner
@@ -45,15 +48,18 @@ jobs:
- uses: actions/checkout@v6
with:
submodules: true
- name: Install zsh and additional shells
- name: Install zsh, additional shells, and awk variant
run: |
sudo apt-get update
sudo apt-get install -y zsh
sudo apt-get install -y zsh ${{ matrix.awk }}
if [ "${{ matrix.shell }}" != "sh" ] && [ "${{ matrix.shell }}" != "bash" ] && [ "${{ matrix.shell }}" != "zsh" ]; then
sudo apt-get install -y ${{ matrix.shell }}
fi
# Set the selected awk as the default
sudo update-alternatives --set awk /usr/bin/${{ matrix.awk }}
shell: bash
- run: sudo ${{ matrix.shell }} --version 2> /dev/null || dpkg -s ${{ matrix.shell }} 2> /dev/null || which ${{ matrix.shell }}
- run: awk --version 2>&1 | head -1 || awk -W version 2>&1 | head -1
- run: curl --version
- run: wget --version
- uses: ljharb/actions/node/install@main

View File

@@ -58,22 +58,34 @@ jobs:
docker run --rm \
-v "${{ github.workspace }}:/workspace" \
-w /workspace \
-e "SHELL=${{ matrix.shell }}" \
-e "NVM_DIR=/workspace" \
-e "TEST_SHELL=${{ matrix.shell }}" \
-e "TERM=xterm-256color" \
-e "DEBIAN_FRONTEND=noninteractive" \
-e "GITHUB_ACTIONS=true" \
-e "WITHOUT_CURL=${{ matrix.without_curl }}" \
ubuntu:16.04 \
bash -c '
set -ex
apt-get update
# Retry apt-get update up to 5 times due to flaky Ubuntu mirrors
# apt-get update can return 0 even with partial failures, so check for warnings
for i in 1 2 3 4 5; do
if apt-get update 2>&1 | tee /tmp/apt-update.log | grep -qE "^(W:|E:|Err:)"; then
echo "apt-get update had warnings/errors, attempt $i/5"
cat /tmp/apt-update.log
sleep $((i * 5))
else
break
fi
done
apt-get install -y git curl wget make build-essential python zsh libssl-dev
if [ "${{ matrix.shell }}" != "sh" ] && [ "${{ matrix.shell }}" != "bash" ]; then
apt-get install -y ${{ matrix.shell }} || true
if [ "$TEST_SHELL" != "sh" ] && [ "$TEST_SHELL" != "bash" ]; then
apt-get install -y $TEST_SHELL || true
fi
# Use nvm to install Node.js for running urchin
# Node 16 is the last version supporting GLIBC 2.27 (Ubuntu 18.04)
# Node 16 is the last version supporting GLIBC 2.23 (Ubuntu 16.04)
export NVM_DIR="/workspace"
. /workspace/nvm.sh
nvm install 16
@@ -88,13 +100,16 @@ jobs:
! command -v curl
fi
# Now unset nvm stuff for the actual tests
# Now clean up nvm state for the actual tests, but keep NVM_DIR set
nvm deactivate || true
nvm unalias default || true
unset NVM_CD_FLAGS NVM_BIN NVM_INC
export PATH="$(echo "$PATH" | tr ":" "\n" | grep -v "\.nvm" | grep -v "toolcache" | tr "\n" ":")"
make TEST_SUITE="installation_node" SHELL="${{ matrix.shell }}" URCHIN="$URCHIN_PATH" test-${{ matrix.shell }}
# Clean any cached files from the nvm install above
rm -rf "$NVM_DIR/.cache" "$NVM_DIR/versions" "$NVM_DIR/alias"
make TEST_SUITE="installation_node" SHELL="$TEST_SHELL" URCHIN="$URCHIN_PATH" test-$TEST_SHELL
'
all:

View File

@@ -55,21 +55,33 @@ jobs:
docker run --rm \
-v "${{ github.workspace }}:/workspace" \
-w /workspace \
-e "SHELL=${{ matrix.shell }}" \
-e "NVM_DIR=/workspace" \
-e "TEST_SHELL=${{ matrix.shell }}" \
-e "TERM=xterm-256color" \
-e "DEBIAN_FRONTEND=noninteractive" \
-e "GITHUB_ACTIONS=true" \
ubuntu:16.04 \
bash -c '
set -ex
apt-get update
# Retry apt-get update up to 5 times due to flaky Ubuntu mirrors
# apt-get update can return 0 even with partial failures, so check for warnings
for i in 1 2 3 4 5; do
if apt-get update 2>&1 | tee /tmp/apt-update.log | grep -qE "^(W:|E:|Err:)"; then
echo "apt-get update had warnings/errors, attempt $i/5"
cat /tmp/apt-update.log
sleep $((i * 5))
else
break
fi
done
apt-get install -y git curl wget make build-essential python zsh libssl-dev
if [ "${{ matrix.shell }}" != "sh" ] && [ "${{ matrix.shell }}" != "bash" ]; then
apt-get install -y ${{ matrix.shell }} || true
if [ "$TEST_SHELL" != "sh" ] && [ "$TEST_SHELL" != "bash" ]; then
apt-get install -y $TEST_SHELL || true
fi
# Use nvm to install Node.js for running urchin
# Node 16 is the last version supporting GLIBC 2.27 (Ubuntu 18.04)
# Node 16 is the last version supporting GLIBC 2.23 (Ubuntu 16.04)
export NVM_DIR="/workspace"
. /workspace/nvm.sh
nvm install 16
@@ -78,13 +90,16 @@ jobs:
npm ls urchin
URCHIN_PATH="$(npx which urchin)"
# Now unset nvm stuff for the actual tests
# Now clean up nvm state for the actual tests, but keep NVM_DIR set
nvm deactivate || true
nvm unalias default || true
unset NVM_CD_FLAGS NVM_BIN NVM_INC
export PATH="$(echo "$PATH" | tr ":" "\n" | grep -v "\.nvm" | grep -v "toolcache" | tr "\n" ":")"
make TEST_SUITE="xenial" SHELL="${{ matrix.shell }}" URCHIN="$URCHIN_PATH" test-${{ matrix.shell }}
# Clean any cached files from the nvm install above
rm -rf "$NVM_DIR/.cache" "$NVM_DIR/versions" "$NVM_DIR/alias"
make TEST_SUITE="xenial" SHELL="$TEST_SHELL" URCHIN="$URCHIN_PATH" test-$TEST_SHELL
'
all:

34
nvm.sh
View File

@@ -2642,18 +2642,24 @@ nvm_install_source() {
NVM_OS="$(nvm_get_os)"
local make
make='make'
local MAKE_CXX
# For old Node.js versions (< 0.12), explicitly set SHELL=/bin/sh to avoid
# issues with zsh's strict glob handling in Makefiles with unquoted globs
local MAKE_SHELL_OVERRIDE
if nvm_version_greater "0.12.0" "${VERSION}"; then
MAKE_SHELL_OVERRIDE=' SHELL=/bin/sh'
fi
make="make${MAKE_SHELL_OVERRIDE-}"
case "${NVM_OS}" in
'freebsd' | 'openbsd')
make='gmake'
make="gmake${MAKE_SHELL_OVERRIDE-}"
MAKE_CXX="CC=${CC:-cc} CXX=${CXX:-c++}"
;;
'darwin')
MAKE_CXX="CC=${CC:-cc} CXX=${CXX:-c++}"
;;
'aix')
make='gmake'
make="gmake${MAKE_SHELL_OVERRIDE-}"
;;
esac
if nvm_has "clang++" && nvm_has "clang" && nvm_version_greater_than_or_equal_to "$(nvm_clang_version)" 3.5; then
@@ -2788,16 +2794,12 @@ nvm_die_on_prefix() {
# npm first looks at $PREFIX (case-sensitive)
# we do not bother to test the value here; if this env var is set, unset it to continue.
# however, `npm exec` in npm v7.2+ sets $PREFIX; if set, inherit it
if [ -n "${PREFIX-}" ]; then
local NVM_NODE_VERSION
NVM_NODE_VERSION="$(node -v 2>/dev/null)"
if [ -z "${NVM_NODE_VERSION}" ] || [ "$(nvm_version_path "${NVM_NODE_VERSION}" 2>/dev/null)" != "${PREFIX}" ]; then
if [ -n "${PREFIX-}" ] && [ "$(nvm_version_path "$(node -v)")" != "${PREFIX}" ]; then
nvm deactivate >/dev/null 2>&1
nvm_err "nvm is not compatible with the \"PREFIX\" environment variable: currently set to \"${PREFIX}\""
nvm_err 'Run `unset PREFIX` to unset it.'
return 3
fi
fi
local NVM_OS
NVM_OS="$(nvm_get_os)"
@@ -4528,9 +4530,9 @@ nvm_get_default_packages() {
NVM_DEFAULT_PACKAGE_FILE="${NVM_DIR}/default-packages"
if [ -f "${NVM_DEFAULT_PACKAGE_FILE}" ]; then
command awk -v filename="${NVM_DEFAULT_PACKAGE_FILE}" '
/^[[:space:]]*#/ { next } # Skip lines that begin with #
/^[[:space:]]*$/ { next } # Skip empty lines
/[[:space:]]/ && !/^[[:space:]]*#/ {
/^[ \t]*#/ { next } # Skip lines that begin with #
/^[ \t]*$/ { next } # Skip empty lines
/[ \t]/ && !/^[ \t]*#/ {
print "Only one package per line is allowed in `" filename "`. Please remove any lines with multiple space-separated values." > "/dev/stderr"
err = 1
exit 1
@@ -4628,24 +4630,24 @@ nvm_auto() {
VERSION="$(nvm_resolve_local_alias default 2>/dev/null || nvm_echo)"
if [ -n "${VERSION}" ]; then
if [ "_${VERSION}" != '_N/A' ] && nvm_is_valid_version "${VERSION}"; then
nvm use --silent "${VERSION}" >/dev/null || :
nvm use --silent "${VERSION}" >/dev/null
else
return 0
fi
elif nvm_rc_version >/dev/null 2>&1; then
nvm use --silent >/dev/null || :
nvm use --silent >/dev/null
fi
else
nvm use --silent "${NVM_CURRENT}" >/dev/null || :
nvm use --silent "${NVM_CURRENT}" >/dev/null
fi
;;
install)
local VERSION
VERSION="$(nvm_alias default 2>/dev/null || nvm_echo)"
if [ -n "${VERSION}" ] && [ "_${VERSION}" != '_N/A' ] && nvm_is_valid_version "${VERSION}"; then
nvm install "${VERSION}" >/dev/null || :
nvm install "${VERSION}" >/dev/null
elif nvm_rc_version >/dev/null 2>&1; then
nvm install >/dev/null || :
nvm install >/dev/null
else
return 0
fi

View File

@@ -2,10 +2,6 @@
die () { echo "$@" ; cleanup ; exit 1; }
strip_colors() {
command sed $'s/\x1b\\[[0-9;]*m//g'
}
cleanup() {
unset -f nvm_download nvm_ls_remote nvm_ls_remote_iojs
if [ -n "${TEMP_NVM_COLORS-}" ]; then
@@ -49,22 +45,22 @@ nvm_download() {
}
EXPECTED_OUTPUT_PATH="${MOCKS_DIR}/nvm ls-remote lts.txt"
OUTPUT="$(nvm ls-remote --lts | strip_colors | sed 's/[ \t]*$//')"
EXPECTED_OUTPUT="$(cat "${EXPECTED_OUTPUT_PATH}" | strip_colors | sed 's/[ \t]*$//' )"
OUTPUT="$(nvm ls-remote --lts | sed 's/[ \t]*$//')"
EXPECTED_OUTPUT="$(cat "${EXPECTED_OUTPUT_PATH}" | sed 's/[ \t]*$//' )"
[ "_${OUTPUT}" = "_${EXPECTED_OUTPUT}" ] || die "nvm ls-remote --lts did not output expected sorted versions; got >${OUTPUT}< expected >${EXPECTED_OUTPUT}<"
EXPECTED_OUTPUT_PATH="${MOCKS_DIR}/nvm ls-remote lts.txt"
OUTPUT="$(nvm ls-remote "lts/*" | strip_colors | sed 's/[ \t]*$//')"
EXPECTED_OUTPUT="$(cat "${EXPECTED_OUTPUT_PATH}" | strip_colors | sed 's/[ \t]*$//' )"
OUTPUT="$(nvm ls-remote "lts/*" | sed 's/[ \t]*$//')"
EXPECTED_OUTPUT="$(cat "${EXPECTED_OUTPUT_PATH}" | sed 's/[ \t]*$//' )"
[ "_${OUTPUT}" = "_${EXPECTED_OUTPUT}" ] || die "nvm ls-remote lts/* did not output expected sorted versions; got >${OUTPUT}< expected >${EXPECTED_OUTPUT}<"
LTS_LIST="$(cat "${LTS_NAMES_PATH}" | tail -n +2)"
INDEX=1
printf '%s\n' "${LTS_LIST}" | while IFS= read -r LTS; do
ACTUAL="$(nvm ls-remote "lts/-${INDEX}" | strip_colors | sed 's/[ \t]*$//')"
ACTUAL="$(nvm ls-remote "lts/-${INDEX}" | sed 's/[ \t]*$//')"
MESSAGE="for lts/-${INDEX} (${LTS})"
EXPECTED="$(nvm ls-remote "lts/${LTS}" | strip_colors | sed 's/[ \t]*$//')"
EXPECTED="$(nvm ls-remote "lts/${LTS}" | sed 's/[ \t]*$//')"
[ "${ACTUAL}" = "${EXPECTED}" ] || die "${MESSAGE}: expected >${EXPECTED}<, got >${ACTUAL}<"
INDEX=$(($INDEX + 1))
@@ -73,7 +69,6 @@ done
OUTPUT="$(nvm ls-remote lts/ARGON 2>&1)"
EXIT_CODE=$?
[ $EXIT_CODE -eq 3 ] || die "nvm ls-remote lts/ARGON did not exit 3, got '${EXIT_CODE}'"
OUTPUT="$(echo "${OUTPUT}" | strip_colors)"
EXPECTED_OUTPUT="LTS names must be lowercase
N/A"
@@ -89,8 +84,8 @@ nvm_ls_remote_iojs() {
}
EXPECTED_OUTPUT_PATH="${MOCKS_DIR}/nvm ls-remote.txt"
OUTPUT="$(nvm ls-remote | strip_colors | sed 's/[ \t]*$//')"
EXPECTED_OUTPUT="$(cat "${EXPECTED_OUTPUT_PATH}" | strip_colors | sed 's/[ \t]*$//' )"
OUTPUT="$(nvm ls-remote | sed 's/[ \t]*$//')"
EXPECTED_OUTPUT="$(cat "${EXPECTED_OUTPUT_PATH}" | sed 's/[ \t]*$//' )"
[ "_${OUTPUT}" = "_${EXPECTED_OUTPUT}" ] || die "bare nvm ls-remote did not output expected sorted versions; got >${OUTPUT}< expected >${EXPECTED_OUTPUT}<"
cleanup

View File

@@ -0,0 +1,57 @@
#!/bin/sh
# Test that nvm_get_default_packages awk patterns work with mawk
# This test runs with mawk explicitly if available, to catch POSIX
# character class compatibility issues (mawk doesn't support [[:space:]])
die () { echo "$@" ; cleanup ; exit 1; }
\. ../../../nvm.sh
# The awk command from nvm_get_default_packages
AWK_SCRIPT='
/^[ \t]*#/ { next }
/^[ \t]*$/ { next }
/[ \t]/ && !/^[ \t]*#/ {
print "error" > "/dev/stderr"
exit 1
}
{
if (NR > 1 && !prev_space) printf " "
printf "%s", $0
prev_space = 0
}
'
TEST_INPUT="rimraf
object-inspect@1.0.2
# commented-package
stevemao/left-pad"
EXPECTED_OUTPUT="rimraf object-inspect@1.0.2 stevemao/left-pad"
# Test with system awk
OUTPUT="$(printf '%s\n' "${TEST_INPUT}" | awk "${AWK_SCRIPT}")"
[ "${OUTPUT}" = "${EXPECTED_OUTPUT}" ] || die "system awk: expected >${EXPECTED_OUTPUT}<, got >${OUTPUT}<"
# Test with mawk explicitly if available
if command -v mawk > /dev/null 2>&1; then
OUTPUT="$(printf '%s\n' "${TEST_INPUT}" | mawk "${AWK_SCRIPT}")"
[ "${OUTPUT}" = "${EXPECTED_OUTPUT}" ] || die "mawk: expected >${EXPECTED_OUTPUT}<, got >${OUTPUT}<"
echo "mawk test passed"
else
echo "mawk not available, skipping mawk-specific test"
fi
# Test with gawk explicitly if available
if command -v gawk > /dev/null 2>&1; then
OUTPUT="$(printf '%s\n' "${TEST_INPUT}" | gawk "${AWK_SCRIPT}")"
[ "${OUTPUT}" = "${EXPECTED_OUTPUT}" ] || die "gawk: expected >${EXPECTED_OUTPUT}<, got >${OUTPUT}<"
echo "gawk test passed"
else
echo "gawk not available, skipping gawk-specific test"
fi
echo "All awk compatibility tests passed"

View File

@@ -0,0 +1,91 @@
#!/bin/sh
cleanup () {
unset -f make gmake nvm_download nvm_get_os nvm_get_arch nvm_extract_tarball nvm_version_path nvm_get_make_jobs
rm -rf "${FAKE_TMPDIR-}"
}
die () { echo "$@" ; cleanup ; exit 1; }
\. ../../../nvm.sh
# Create a fake directory structure for the build
FAKE_TMPDIR="$(mktemp -d)"
mkdir -p "${FAKE_TMPDIR}/files"
touch "${FAKE_TMPDIR}/node-old.tar.gz"
touch "${FAKE_TMPDIR}/node-new.tar.gz"
# Track make invocations
MAKE_CALLS=""
make() {
MAKE_CALLS="${MAKE_CALLS}make $*
"
return 1 # Fail to prevent actual build
}
gmake() {
MAKE_CALLS="${MAKE_CALLS}gmake $*
"
return 1 # Fail to prevent actual build
}
nvm_download() {
return 0
}
nvm_get_arch() {
echo "x64"
}
nvm_extract_tarball() {
return 0
}
nvm_version_path() {
echo "${FAKE_TMPDIR}/versions/${1}"
}
nvm_get_make_jobs() {
NVM_MAKE_JOBS=1
}
# Test 1: Old version (0.6.21) should have SHELL=/bin/sh
MAKE_CALLS=""
NVM_DIR="${FAKE_TMPDIR}"
export NVM_DIR
# Manually test the version check logic
if nvm_version_greater "0.12.0" "0.6.21"; then
OLD_VERSION_DETECTED="yes"
else
OLD_VERSION_DETECTED="no"
fi
[ "${OLD_VERSION_DETECTED}" = "yes" ] || die "Expected 0.6.21 to be detected as old version"
# Test 2: New version (0.12.0) should NOT have SHELL=/bin/sh
if nvm_version_greater "0.12.0" "0.12.0"; then
NEW_VERSION_DETECTED="yes"
else
NEW_VERSION_DETECTED="no"
fi
[ "${NEW_VERSION_DETECTED}" = "no" ] || die "Expected 0.12.0 to NOT be detected as old version"
# Test 3: Newer version (14.0.0) should NOT have SHELL=/bin/sh
if nvm_version_greater "0.12.0" "14.0.0"; then
NEWER_VERSION_DETECTED="yes"
else
NEWER_VERSION_DETECTED="no"
fi
[ "${NEWER_VERSION_DETECTED}" = "no" ] || die "Expected 14.0.0 to NOT be detected as old version"
# Test 4: Edge case version (0.11.99) should have SHELL=/bin/sh
if nvm_version_greater "0.12.0" "0.11.99"; then
EDGE_VERSION_DETECTED="yes"
else
EDGE_VERSION_DETECTED="no"
fi
[ "${EDGE_VERSION_DETECTED}" = "yes" ] || die "Expected 0.11.99 to be detected as old version"
echo "All nvm_install_source SHELL override tests passed"
cleanup

View File

@@ -43,6 +43,13 @@ nvm_install_source() {
return 1
}
# Override nvm_get_make_jobs to produce predictable output regardless of actual CPU count
nvm_get_make_jobs() {
NVM_MAKE_JOBS=1
nvm_echo "Detected that you have 2 CPU core(s)"
nvm_echo 'Number of CPU core(s) less than or equal to 2, running in single-threaded mode'
}
# binary fails, falls back to source if -b is not set
OUTPUT="$(nvm install 9.0.0 2>&1)"
EXPECTED_OUTPUT="binary failed