From ea4264645b07484dc071f4027f003804cd6e2893 Mon Sep 17 00:00:00 2001 From: elliottcable Date: Sat, 7 Feb 2015 21:12:46 -0600 Subject: [PATCH] install: support `npm`s lower than v2 --- install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index b3ca449..63a7af4 100755 --- a/install.sh +++ b/install.sh @@ -150,9 +150,9 @@ nvm_check_global_modules() { local NPM_VERSION NPM_VERSION="$(npm --version)" - NPM_VERSION="${NPM_VERSION:-0}" + NPM_VERSION="${NPM_VERSION:--1}" [ "$NVM_DEBUG" = 0 ] && debug "NPM detected (at version ${NPM_VERSION}.)" - [ "${NPM_VERSION%%[!0-9]*}" -gt 1 ] || return 0 + [ "${NPM_VERSION%%[!0-9]*}" -gt 0 ] || return 0 local NPM_GLOBAL_MODULES NPM_GLOBAL_MODULES="$(npm list -g --depth=0 | sed '/ npm@/d')"