mirror of
https://github.com/nvm-sh/nvm.git
synced 2025-05-10 14:21:50 +00:00
install: support npm
s lower than v2
This commit is contained in:
parent
a216f56443
commit
ea4264645b
@ -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')"
|
||||
|
Loading…
Reference in New Issue
Block a user