[Fix] `nvm_print_npm_version`: if `npm` exists but its node crashes, do not print the npm version
parent
a07cd41af1
commit
c08b38a2a4
6
nvm.sh
6
nvm.sh
|
@ -163,7 +163,11 @@ nvm_is_version_installed() {
|
|||
|
||||
nvm_print_npm_version() {
|
||||
if nvm_has "npm"; then
|
||||
command printf " (npm v$(npm --version 2>/dev/null))"
|
||||
local NPM_VERSION
|
||||
NPM_VERSION="$(npm --version 2>/dev/null)"
|
||||
if [ -n "${NPM_VERSION}" ]; then
|
||||
command printf " (npm v${NPM_VERSION})"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue