Print the `npm` version when using `nvm exec` or `nvm run`.

Jordan Harband 2015-09-23 05:02:41 -07:00
parent c64a0343af
commit 7496a24bd6
1 changed files with 3 additions and 3 deletions

6
nvm.sh
View File

@ -1713,11 +1713,11 @@ nvm() {
fi fi
EXIT_CODE="$?" EXIT_CODE="$?"
elif [ "$NVM_IOJS" = true ]; then elif [ "$NVM_IOJS" = true ]; then
echo "Running io.js $(nvm_strip_iojs_prefix "$VERSION")" echo "Running io.js $(nvm_strip_iojs_prefix "$VERSION")$(nvm_print_npm_version)"
OUTPUT="$(nvm use "$VERSION" >/dev/null && iojs $ARGS)" OUTPUT="$(nvm use "$VERSION" >/dev/null && iojs $ARGS)"
EXIT_CODE="$?" EXIT_CODE="$?"
else else
echo "Running node $VERSION" echo "Running node $VERSION$(nvm_print_npm_version)"
OUTPUT="$(nvm use "$VERSION" >/dev/null && node $ARGS)" OUTPUT="$(nvm use "$VERSION" >/dev/null && node $ARGS)"
EXIT_CODE="$?" EXIT_CODE="$?"
fi fi
@ -1751,7 +1751,7 @@ nvm() {
return $EXIT_CODE return $EXIT_CODE
fi fi
echo "Running node $VERSION" echo "Running node $VERSION$(nvm_print_npm_version)"
NODE_VERSION="$VERSION" $NVM_DIR/nvm-exec "$@" NODE_VERSION="$VERSION" $NVM_DIR/nvm-exec "$@"
;; ;;
"ls" | "list" ) "ls" | "list" )