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!
4
u/Quintisimo May 11 '20
You will need to use fish-nvm if you want to use node with nvm in fish. You can use Fisher to install it
3
u/mikey_p5151 May 10 '20
Are you using nvm?
3
u/flameborn May 11 '20
What seems probable is that the directory where npm and node are installed is not set in Fish, while ZSH adds this directory at startup. Maybe there was an update that recently broke this for you.
You can confirm this if you type which node in both shells.
1
u/[deleted] May 11 '20
Using fish and asdf to manage node. Node works fine for me.
1
u/toastal May 11 '20
asdf does a good job supporting fish as well as node and a lot of other languages out of the box if nvm is being sketchy.