I really just need something I can check into version control to declare a Node version, and swap out the Node version in someone's shell while they're in that directory.
.nvmrc
is supposed to do this but there's no official support for Fish and workarounds are junk.
This doesn't seem terribly complicated. Is there anything new/hawt to replace nvm?
I use volta as replacement. It doesn't use the .nvmrc
but a configuration in the package.json
.
It's a great solution in my eyes because it uses shims, so it is completely independent of the shell you use. It doesn't has to be integrated in there. Instead of a normal node installation you (or the installation) puts volta in the PATH variable of you OS. So you are using node
, npm
, yarn
, ... normally, but internally it's calling volta and volta checks your package.json and uses the node/yarn/... version configured there, or the global version if there is no volta configuration. So if you switch a project with cd ../xyz
volta also changes the node version or installs it if it is missing without the need to run a command or something. So no nvm use
or fnm use
necessary.
Except from IntelliJ-Issue WEB-44867 (that requires a bit of manual extra configuration) it works perfectly for me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With