Skip to content
Myr

Include npm version when displaying results of switch.

Before adoption: this commit came in with the history the project adopted, so no landing records it.

When running nvm use, successful changing of versions lists the new node version. The npm version may also be switched, but this is not listed. This commit updates nvm to display the npm version that was switched to alongside the node version

authored by Andrew Crites · committed by Andrew Crites · parent 276d55c · Browse files · 1 file+5 added−4 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+5 added−4 removed

  • other:+5 added−4 removed

1 file+5 added−4 removed

modified:nvm.sh+5 added-4 removed
1358 unmodified lines
1359 fi13601361 if [ "_$VERSION" = '_system' ]; then1362 if nvm_has_system_node && nvm deactivate >/dev/null 2>&1; then1363 echo "Now using system version of node: $(node -v 2>/dev/null)."1363 echo "Now using system version of node: $(node -v 2>/dev/null) (npm v$(npm --version 2>/dev/null))"1364 return1365 elif nvm_has_system_iojs && nvm deactivate >/dev/null 2>&1; then1366 echo "Now using system version of io.js: $(iojs --version 2>/dev/null)."1366 echo "Now using system version of io.js: $(iojs --version 2>/dev/null) (npm v$(npm --version 2>/dev/null))"1367 return1368 else1369 echo "System version of node not found." >&21370 return 127
35 unmodified lines
1406 if [ "$NVM_SYMLINK_CURRENT" = true ]; then1407 command rm -f "$NVM_DIR/current" && ln -s "$NVM_VERSION_DIR" "$NVM_DIR/current"1408 fi1409 if nvm_is_iojs_version "$VERSION"; then1410 echo "Now using io.js $(nvm_strip_iojs_prefix "$VERSION")"1410 echo -n "Now using io.js $(nvm_strip_iojs_prefix "$VERSION")"1411 else1412 echo "Now using node $VERSION"1412 echo -n "Now using node $VERSION"1413 fi1414 echo " (npm v$(npm --version 2>/dev/null))"1415 ;;1416 "run" )1417 local provided_version1418 local has_checked_nvmrc
344 unmodified lines