From a430aab4f988a73bc8c402542acdbd66111dbd17 Mon Sep 17 00:00:00 2001 From: Eric Henderson Date: Mon, 4 Mar 2024 10:40:01 -0500 Subject: [PATCH] fix the case when there is no node at all --- zsh-nvm.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zsh-nvm.plugin.zsh b/zsh-nvm.plugin.zsh index e2ef031..6675ba2 100644 --- a/zsh-nvm.plugin.zsh +++ b/zsh-nvm.plugin.zsh @@ -173,7 +173,7 @@ _current_node_version() { _node_is_nvm() { local node_path="$(command which node 2>/dev/null)" - if [[ -z "${node_path##$NVM_DIR*}" ]]; then + if [[ -n "$node_path" && -z "${node_path##$NVM_DIR*}" ]]; then return 0 else return 1