From f10504b11c400a6d09a6b5d685856737f6f7960d Mon Sep 17 00:00:00 2001 From: Sunil Thaha Date: Fri, 25 Jul 2014 19:33:08 +1000 Subject: [PATCH] Suppress error message when node is not in path When nvm.sh is sourced in bashrc or zshrc, and if node is not found in the path, an error message is shown since which node fails. The patch suppresses this error message. --- nvm.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nvm.sh b/nvm.sh index f7d3f32..c2ad177 100644 --- a/nvm.sh +++ b/nvm.sh @@ -161,7 +161,7 @@ nvm_binary_available() { nvm_ls_current() { local NODE_PATH - NODE_PATH="$(which node)" + NODE_PATH="$(which node 2>/dev/null)" if [ $? -ne 0 ]; then echo 'none' elif nvm_tree_contains_path "$NVM_DIR" "$NODE_PATH"; then