Skip to content

Commit

Permalink
[Fix] avoid overridden hash
Browse files Browse the repository at this point in the history
Fixes #3239
  • Loading branch information
ljharb committed Nov 25, 2023
1 parent 99646ee commit cc765cc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions nvm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3559,7 +3559,7 @@ nvm() {
fi
else
export PATH="${NEWPATH}"
hash -r
command hash -r
if [ "${NVM_SILENT:-0}" -ne 1 ]; then
nvm_echo "${NVM_DIR}/*/bin removed from \${PATH}"
fi
Expand Down Expand Up @@ -3691,7 +3691,7 @@ nvm() {
export MANPATH
fi
export PATH
hash -r
command hash -r
export NVM_BIN="${NVM_VERSION_DIR}/bin"
export NVM_INC="${NVM_VERSION_DIR}/include/node"
if [ "${NVM_SYMLINK_CURRENT-}" = true ]; then
Expand Down

4 comments on commit cc765cc

@whao
Copy link

@whao whao commented on cc765cc Dec 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I got the error of nvm:867: command not found: hash in zsh.
I am using zsh with oh-my-zsh. I have sourced nvm.sh at the top in the .zshrc.
try command hash return zsh: command not found: hash but works fine in the bash

@jorbuedo
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same error, same circumstances.

@dharrigan
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See: #3247

@jorbuedo
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, was going to open one!

Please sign in to comment.