No builtin
before builtin functions can break NVM when those functions are overwriten
#3239
Labels
shell alias clobbering
Anything dealing with users shadowing builtins with aliases or functions.
I know the prompt said not to delete any parts. I don't care enough to fill it all out because the fix to this issue is so small
Operating system and version:
Windows 11, WSL Ubuntu, ZSH, NVM V0.39.5
How did you install
nvm
?Install script
What steps did you perform?
See below
Is there anything in any of your profile files that modifies the
PATH
?No
The issue and its fix is just to add the
builtin
keyword before each call of a builtin function.In my case, I declared a function called
hash
in my.zshrc
which overwrites the builtinhash
function beforenvm.sh
gets sourced.nvm.sh
calls this new, overwritten hash function which may cause unintended behavior. I replaced the two calls ofhash
I could find in my build ofnvm.sh
withbuiltin hash
instead and this fixed my issue.This fix shouldn't break anything because it will always reference the intended
hash
function.I know I could fix this by putting the lines
before the part that sources all my custom
.zsh
files, but I found this issue and figured I would report it.Side note:
I don't really use NVM or even Node, so I don't know what errors this specific case might cause.
What I did to cause this issue (overwriting the hash function) probably breaks some aspect of nvm so if someone does the same thing it might lead someone in the complete wrong direction of how to fix their issue.
The only reason I caught this was because of the way I implemented my
hash
function which caused there to be some output whenever I opened up a new terminal.The text was updated successfully, but these errors were encountered: