From bf7bd3e793adfac2069f2f4bc5225765d347fa25 Mon Sep 17 00:00:00 2001 From: HE Shi-Jun Date: Wed, 11 Mar 2015 18:12:01 +0800 Subject: [PATCH] Only filter the package npm, not any package name contains 'npm' --- nvm.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nvm.sh b/nvm.sh index 471e220..a3ddf5a 100755 --- a/nvm.sh +++ b/nvm.sh @@ -1658,11 +1658,11 @@ $NVM_LS_REMOTE_IOJS_OUTPUT" | command grep -v "N/A" | sed '/^$/d')" echo 'No system version of node or io.js detected.' >&2 return 3 fi - INSTALLS=$(nvm deactivate > /dev/null && npm list -g --depth=0 | command tail -n +2 | command grep -o -e ' [^@]*' | command cut -c 2- | command grep -v npm | command xargs) + INSTALLS=$(nvm deactivate > /dev/null && npm list -g --depth=0 | command tail -n +2 | command grep -o -e ' [^@]*' | command cut -c 2- | command grep -vx npm | command xargs) else local VERSION VERSION="$(nvm_version "$PROVIDED_VERSION")" - INSTALLS=$(nvm use "$VERSION" > /dev/null && npm list -g --depth=0 | command tail -n +2 | command grep -o -e ' [^@]*' | command cut -c 2- | command grep -v npm | command xargs) + INSTALLS=$(nvm use "$VERSION" > /dev/null && npm list -g --depth=0 | command tail -n +2 | command grep -o -e ' [^@]*' | command cut -c 2- | command grep -vx npm | command xargs) fi echo "Copying global packages from $VERSION..."