From 2dec01da9cd202a8cd81531f339ed1a19682c765 Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Fri, 8 May 2015 14:24:51 -0700 Subject: [PATCH] nvm reinstall-packages: On systems where `npm ls -g --depth=0` does not include `npm` for some reason, make sure to filter out `(empty)`. --- nvm.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nvm.sh b/nvm.sh index be1e688..34d8562 100755 --- a/nvm.sh +++ b/nvm.sh @@ -1728,7 +1728,7 @@ $NVM_LS_REMOTE_IOJS_OUTPUT" | command grep -v "N/A" | sed '/^$/d')" fi local INSTALLS - INSTALLS=$(echo "$NPMLIST" | command sed -e '/ -> / d' -e 's/^.* \(.*\)@.*/\1/' -e '/^npm$/ d' | command xargs) + INSTALLS=$(echo "$NPMLIST" | command sed -e '/ -> / d' -e '/\(empty\)/ d' -e 's/^.* \(.*\)@.*/\1/' -e '/^npm$/ d' | command xargs) echo "Copying global packages from $VERSION..." echo "$INSTALLS" | command xargs npm install -g --quiet