Alternatives to nvm?

Viewed 14561

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?

5 Answers

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.

I use https://github.com/tj/n (Node.js version management: no subshells, no profile setup, no convoluted API, just simple)

I know this is an old question and this popped up in my search first.

fnm, https://github.com/Schniz/fnm seems to be a good alternative build in Rust. It is and very fast when compared to nvm.

you can use avn-nvm. It uses nvm to manage the Node version, and avn will trigger the switch to the right version for you when you enter the directory. That's what we use in my team.

Related