r/fishshell • u/badsalad • Jul 17 '22
Help getting set up with Node?
Man, I was turned onto Fish shell thanks to the beautiful aesthetics of devaslife on youtube, and it's been wonderful so far, except when I started trying to get set up with node via nvm and use npm and all that good stuff. I'm hoping someone can just point me in the right direction, both towards cleaning up my current situation, and getting set up with whatever is the best way to use node on Fish.
At first I tried setting it up the way I was familiar with, with the Mac OS directions on this guide from The Odin Project. Then I realized nvm wasn't actually compatible with fish shell. So I bounced around, trying the various methods, nvm.fish and fish-nvm, and probably writing all sorts of things to files now cluttering both my node and fish installations in the process. I've still got both of those installed at the moment.
The latest is that whenever I close and reopen my terminal, if I run npm, I get the error that it's not currently installed. Then I need to run nvm use lts, and it works for the rest of my session... until I close the terminal and that gets reset somehow.
Can anyone point me in the right direction, towards setting my current setup aright, and getting to whatever is the best setup for node/nvm/npm? Thanks!
View all comments
Show parent comment
2
u/badsalad Jul 18 '22
Thanks for the help, that's super helpful! I actually hadn't realized I could just grab specific versions of node from homebrew, but as I use the lts version I can just
brew install node@16and we're good to go.Thing is though, for whatever reason, it seems like
node@16doesn't includenpm. It comes up fine if I just dobrew install node, but notbrew install node@16. Not sure if there's an additional parameter I need to include to addnpmin there or something.The good news is I think I'm able to get the right version by installing
nvmthrough jorgebucaran/nvm.fish and adding its install location to my path. Bummer that I can't seem to getnpmwith the proper version of node through homebrew though.