npm ls has a bug in some versions when "--parseable --depth=0" is used together.

This commit is contained in:
Jordan Harband
2014-09-02 15:04:35 -07:00
parent 603253b0cb
commit 214ce8853b
2 changed files with 3 additions and 3 deletions

2
nvm.sh
View File

@@ -789,7 +789,7 @@ nvm() {
# declare local INSTALLS first, otherwise it doesn't work in zsh
local INSTALLS
INSTALLS=$(nvm use $VERSION > /dev/null && npm list --global --parseable --depth=0 2> /dev/null | tail -n +2 | \grep -o -e '/[^/]*$' | cut -c 2- | \grep -v npm | xargs)
INSTALLS=$(nvm use "$VERSION" > /dev/null && npm list -g --depth=0 | tail -n +2 | \grep -o -e ' [^@]*' | cut -c 2- | \grep -v npm | xargs)
echo "$INSTALLS" | xargs npm install -g --quiet
;;