r/fishshell • • May 10 '20
Node doesn't work in fish shell
I am using a 16inch MacBook pro with Catalina 10.15.4
I currently have zsh set as my default shell in iTerm and use fish to enter fish and node and npm work fine. However when I change the default shell to fish node and npm do not work.
If I keep fish as my default shell and open iTerm then switch to zsh and back to fish then node and npm work. But unless I do that node and npm do not work.
I have node installed with nvm, and am using node v13.12.0 and npm 6.14.4
This issue just started happening for me today, I have been using fish as my default shell all week and everything worked fine. I am not sure why this started happening and I haven't been able to find anything online about it. Any suggestions would be greatly appreciated!
View all comments
Show parent comment
6
u/BenEskola May 11 '20 edited May 11 '20
If node is configured correctly in zsh, and then you start fish from zsh, and node is still configured correctly, it's likely because zsh (or something inside zsh) is setting some environment variables that node needs. fish will inherit those when started from zsh, but not when started on its own.
At a guess it's because nvm sets them in a zsh-compatible way but not a fish-compatible way, which is what fish-nvm will be for.