Skip to content
Myr

Global modules should not be requireable, and `npm root -g` should not be in `$NODE_PATH`.

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

Fixes #586.

authored by Jordan Harband · committed by Jordan Harband · parent 0527438 · Browse files · 2 files+3 added−9 removed
This commit

State

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

Diff stats

2 files+3 added−9 removed

  • tests:+2 added−1 removed
  • other:+1 added−8 removed

2 files+3 added−9 removed

modified:test/fast/Running "nvm deactivate" should unset the nvm environment variables.+2 added-1 removed
6 unmodified lines
7[ `expr $PATH : ".*v0.2.3/.*/bin"` = 0 ] || echo "WARNING: Unexpectedly found v0.2.3 already active" >&289. ../../nvm.sh10nvm use v0.2.3 &&11[ `expr $PATH : ".*v0.2.3/.*/bin"` != 0 ] && [ `expr $NODE_PATH : ".*v0.2.3/.*/lib/node_modules"` != 0 ] || die "Failed to activate v0.2.3"11[ `expr $PATH : ".*v0.2.3/.*/bin"` != 0 ] && [ `expr $NODE_PATH : ".*v0.2.3/.*/lib/node_modules"` = 0 ] || die "Failed to activate v0.2.3"12# ^ note: NODE_PATH should not contain `npm root -g` since globals should not be requireable1314nvm deactivate &&15[ `expr $PATH : ".*v0.2.3/.*/bin"` = 0 ] && [ `expr $NODE_PATH : ".*v0.2.3/.*/lib/node_modules"` = 0 ] || die "Failed to deactivate v0.2.3"
modified:nvm.sh+1 added-8 removed
788 unmodified lines
789 echo "$NVM_DIR/*/share/man removed from \$MANPATH"790 fi791792 NEWPATH="$(nvm_strip_path "$NODE_PATH" "/lib/node_modules")"793 if [ "$NODE_PATH" = "$NEWPATH" ]; then794 echo "Could not find $NVM_DIR/*/lib/node_modules in \$NODE_PATH" >&2795 else793 if [ "$NODE_PATH" != "$NEWPATH" ]; then794 export NODE_PATH="$NEWPATH"795 echo "$NVM_DIR/*/lib/node_modules removed from \$NODE_PATH"796 fi797 ;;
49 unmodified lines
847 # Prepend current version848 MANPATH=`nvm_prepend_path "$MANPATH" "$NVM_VERSION_DIR/share/man"`849 export MANPATH850 fi853 # Strip other version from NODE_PATH854 NODE_PATH=`nvm_strip_path "$NODE_PATH" "/lib/node_modules"`855 # Prepend current version856 NODE_PATH=`nvm_prepend_path "$NODE_PATH" "$NVM_VERSION_DIR/lib/node_modules"`851 export PATH852 hash -r859 export NODE_PATH853 export NVM_PATH="$NVM_VERSION_DIR/lib/node"854 export NVM_BIN="$NVM_VERSION_DIR/bin"855 if [ "$NVM_SYMLINK_CURRENT" = true ]; then856 rm -f "$NVM_DIR/current" && ln -s "$NVM_VERSION_DIR" "$NVM_DIR/current"
201 unmodified lines