Skip to content

Instantly share code, notes, and snippets.

@alexilyaev
Last active January 20, 2021 09:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexilyaev/b4bd4d0d8d29c1346491fa7c8c9148a0 to your computer and use it in GitHub Desktop.
Save alexilyaev/b4bd4d0d8d29c1346491fa7c8c9148a0 to your computer and use it in GitHub Desktop.
Volta

Volta

https://volta.sh/

A really nice tool to manage the different Node.js/npm/yarn versions between projects:

The problems it solves

  • Making sure everyone who works on the project uses the same Node.js/npm/yarn version for consistent dependencies tree and Node.js execution.
  • Switching the Node.js version when jumping between projects.
  • Not losing your global packages when switching the Node.js version (I think that was a problem with nvm).
  • Cross platform solution (nvm/n don't work on Windows).

Other Notes

  • Built with Rust, so it's really fast.
  • More seamless then the alternatives (nvm auto-switch, avn).
    • Basically it hijacks the precedence of finding the node/npm/yarn executables in your PATH and redirects to the proper versions based on a setting in your package.json.
    • So, it can be installed alongside the other tools to try out and can be removed without causing problems.

I personally uninstalled everything else and now using only Volta.
Although maybe that wasn't such a good idea:
volta-cli/volta#282 (comment)

@alexilyaev
Copy link
Author

Why not engines from package.json?

Why not .nvmrc or .node-version?

@alexilyaev
Copy link
Author

How does it work?

it hijacks the precedence of finding the node/npm/yarn executables in your PATH and redirects to the proper versions based on a setting in your package.json.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment