install: Pass global-module check in the absence of npm

This commit is contained in:
elliottcable
2015-02-02 20:42:12 -06:00
parent dd1a9ca6a0
commit 6cfc309336
2 changed files with 22 additions and 1 deletions

View File

@@ -125,6 +125,13 @@ nvm_detect_profile() {
# Node, and warn them if so.
#
nvm_check_global_modules() {
command -v npm >/dev/null 2>&1 || return 0
local NPM_VERSION
NPM_VERSION="$(npm --version)"
NPM_VERSION="${NPM_VERSION:-0}"
[ "${NPM_VERSION%%[!0-9]*}" -gt 1 ] || return 0
local NPM_GLOBAL_MODULES
NPM_GLOBAL_MODULES=$(npm list -g --depth=0 | sed '/ npm@/d')