mirror of
				https://github.com/nvm-sh/nvm.git
				synced 2025-10-31 01:45:50 +08:00 
			
		
		
		
	install: Pass global-module check in the absence of npm
This commit is contained in:
		| @@ -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') | ||||
|    | ||||
|   | ||||
		Reference in New Issue
	
	Block a user