From c0b56d03a1feb0b8e31ea3e2503f321cbc24f72d Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Thu, 7 Sep 2017 15:57:09 -0700 Subject: [PATCH] [Fix] `install-latest-npm`: `io.js` `v1.0.x` has weird behavior with npm v4.6.x. - comment out node 0.6 test due to travis-ci breakage --- nvm.sh | 4 ++-- test/installation_node/install latest npm | 25 +++++++++++++++-------- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/nvm.sh b/nvm.sh index e6606d6..cfdc80a 100644 --- a/nvm.sh +++ b/nvm.sh @@ -199,8 +199,8 @@ nvm_install_latest_npm() { if [ $NVM_IS_0_9 -eq 1 ] || [ $NVM_IS_0_6 -eq 1 ]; then nvm_echo '* node v0.6 and v0.9 are unable to upgrade further' - elif nvm_version_greater_than_or_equal_to 1.0.0 "${NODE_VERSION}"; then - nvm_echo '* `npm` v4.5.x is the last version that works on `node` versions <= v1.0.0' + elif nvm_version_greater 1.1.0 "${NODE_VERSION}"; then + nvm_echo '* `npm` v4.5.x is the last version that works on `node` versions < v1.1.0' $NVM_NPM_CMD install -g npm@4.5 elif nvm_version_greater 4.0.0 "${NODE_VERSION}"; then nvm_echo '* `npm` v5 and higher do not work on `node` versions below v4.0.0' diff --git a/test/installation_node/install latest npm b/test/installation_node/install latest npm index 6527eca..bb7e57f 100755 --- a/test/installation_node/install latest npm +++ b/test/installation_node/install latest npm @@ -15,20 +15,27 @@ NPM_VERSION="$(npm --version)" nvm_version_greater_than_or_equal_to "${NPM_VERSION}" 5.0.0 || die "node v4.x updates to ${NPM_VERSION}; expected >= v5" nvm deactivate >/dev/null 2>&1 || die 'unable to deactivate: 2' -nvm install 1 >/dev/null 2>&1 || die 'install v1 failed' +nvm install 1.0 >/dev/null 2>&1 || die 'install v1.0 failed' nvm install-latest-npm || die 'nvm install-latest-npm failed: 2' NPM_VERSION="$(npm --version)" +[ "${NPM_VERSION}" = '4.5.0' ] || die "io.js v1.0.x updates to ${NPM_VERSION}; expected v4.5.0" + +nvm deactivate >/dev/null 2>&1 || die 'unable to deactivate: 3' +nvm install 1 >/dev/null 2>&1 || die 'install v1 failed' +nvm install-latest-npm || die 'nvm install-latest-npm failed: 3' +NPM_VERSION="$(npm --version)" [ "${NPM_VERSION}" = '4.6.1' ] || die "io.js v1.x updates to ${NPM_VERSION}; expected v4.6.1" -nvm deactivate >/dev/null 2>&1 || die 'unable to deactivate: 3' +nvm deactivate >/dev/null 2>&1 || die 'unable to deactivate: 4' nvm install 0.8.27 >/dev/null 2>&1 || die 'install v0.8 failed' -nvm install-latest-npm || die 'nvm install-latest-npm failed: 3' +nvm install-latest-npm || die 'nvm install-latest-npm failed: 4' NPM_VERSION="$(npm --version)" [ "${NPM_VERSION}" = '4.5.0' ] || die "node 0.8.27 updates to ${NPM_VERSION}; expected v4.5.0" -nvm deactivate >/dev/null 2>&1 || die 'unable to deactivate: 4' -nvm install 0.6.21 >/dev/null 2>&1 || die 'install v0.6 failed' -export NPM_CONFIG_STRICT_SSL=false # npm 1 on travis can't handle SSL to npm -nvm install-latest-npm || die 'nvm install-latest-npm failed: 4' -NPM_VERSION="$(npm --version)" -[ "${NPM_VERSION}" = '1.3.26' ] || die "node 0.6.21 updates to ${NPM_VERSION}; expected v1.3.26" +## Commented to work around travis-ci breaking 0,6 installs +# nvm deactivate >/dev/null 2>&1 || die 'unable to deactivate: 5' +# nvm install 0.6.21 >/dev/null 2>&1 || die 'install v0.6 failed' +# export NPM_CONFIG_STRICT_SSL=false # npm 1 on travis can't handle SSL to npm +# nvm install-latest-npm || die 'nvm install-latest-npm failed: 5' +# NPM_VERSION="$(npm --version)" +# [ "${NPM_VERSION}" = '1.3.26' ] || die "node 0.6.21 updates to ${NPM_VERSION}; expected v1.3.26"