From c742ab7e66d8b5c432907efd74e8b5bc7be8385e Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Tue, 10 Nov 2015 23:31:16 -0800 Subject: [PATCH] Fix `npm` version output for `nvm run` and `nvm exec` --- nvm.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nvm.sh b/nvm.sh index ed35b90..c3034b9 100755 --- a/nvm.sh +++ b/nvm.sh @@ -1936,11 +1936,11 @@ nvm() { fi EXIT_CODE="$?" elif [ "$NVM_IOJS" = true ]; then - [ $NVM_SILENT -eq 1 ] || echo "Running io.js $(nvm_strip_iojs_prefix "$VERSION")$(nvm_print_npm_version)" + [ $NVM_SILENT -eq 1 ] || echo "Running io.js $(nvm_strip_iojs_prefix "$VERSION")$(nvm use --silent "$VERSION" && nvm_print_npm_version)" OUTPUT="$(nvm use "$VERSION" >/dev/null && iojs $ARGS)" EXIT_CODE="$?" else - [ $NVM_SILENT -eq 1 ] || echo "Running node $VERSION$(nvm_print_npm_version)" + [ $NVM_SILENT -eq 1 ] || echo "Running node $VERSION$(nvm use --silent "$VERSION" && nvm_print_npm_version)" OUTPUT="$(nvm use "$VERSION" >/dev/null && node $ARGS)" EXIT_CODE="$?" fi @@ -1985,7 +1985,7 @@ nvm() { return $EXIT_CODE fi - [ $NVM_SILENT -eq 1 ] || echo "Running node $VERSION$(nvm_print_npm_version)" + [ $NVM_SILENT -eq 1 ] || echo "Running node $VERSION$(nvm use --silent "$VERSION" && nvm_print_npm_version)" NODE_VERSION="$VERSION" "$NVM_DIR/nvm-exec" "$@" ;; "ls" | "list" )