install: support `npm`s lower than v2
parent
a216f56443
commit
ea4264645b
|
@ -150,9 +150,9 @@ nvm_check_global_modules() {
|
||||||
|
|
||||||
local NPM_VERSION
|
local NPM_VERSION
|
||||||
NPM_VERSION="$(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}.)"
|
[ "$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
|
local NPM_GLOBAL_MODULES
|
||||||
NPM_GLOBAL_MODULES="$(npm list -g --depth=0 | sed '/ npm@/d')"
|
NPM_GLOBAL_MODULES="$(npm list -g --depth=0 | sed '/ npm@/d')"
|
||||||
|
|
Loading…
Reference in New Issue