From d7035c5e61b0b9985d3280409632b09f3eef74c9 Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Mon, 3 Aug 2015 16:41:47 -0700 Subject: [PATCH] Redirect stderr output from `npm ls -g` to /dev/null. Fixes #756. --- nvm.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nvm.sh b/nvm.sh index 89dcecf..e5b5c21 100755 --- a/nvm.sh +++ b/nvm.sh @@ -1149,9 +1149,9 @@ nvm_npm_global_modules() { local VERSION VERSION="$1" if [ "_$VERSION" = "_system" ]; then - NPMLIST=$(nvm use system > /dev/null && npm list -g --depth=0 | command tail -n +2) + NPMLIST=$(nvm use system > /dev/null && npm list -g --depth=0 2> /dev/null | command tail -n +2) else - NPMLIST=$(nvm use "$VERSION" > /dev/null && npm list -g --depth=0 | command tail -n +2) + NPMLIST=$(nvm use "$VERSION" > /dev/null && npm list -g --depth=0 2> /dev/null | command tail -n +2) fi local INSTALLS