npm ver could change apart from nac/denac,nvm so prompt should check

This commit is contained in:
Michael Bradley, Jr 2018-08-12 21:25:48 -05:00
parent 4fb228d6fe
commit 08bd3291f5
1 changed files with 4 additions and 0 deletions

View File

@ -34,6 +34,10 @@ __nodez_ne() {
__nodez_nv() { __nodez_nv() {
if [[ -v NODE_VERSION ]]; then if [[ -v NODE_VERSION ]]; then
local nv="${__nodez_char_node}${NODE_VERSION}" local nv="${__nodez_char_node}${NODE_VERSION}"
local npm_version=$(npm --version)
if [[ "$npm_version" != "$NPM_VERSION" ]]; then
export NPM_VERSION=$npm_version
fi
nv+="${__nodez_char_npm}${NPM_VERSION}]" nv+="${__nodez_char_npm}${NPM_VERSION}]"
echo "$nv" echo "$nv"
fi fi