Skip to content

Instantly share code, notes, and snippets.

@alexilyaev
Last active Jan 20, 2021
Embed
What would you like to do?
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:
https://github.com/volta-cli/volta/issues/282#issuecomment-763466956

@alexilyaev

This comment has been minimized.

Copy link
Owner Author

@alexilyaev alexilyaev commented Jan 20, 2021

Why not engines from package.json?

Why not .nvmrc or .node-version?

@alexilyaev

This comment has been minimized.

Copy link
Owner Author

@alexilyaev alexilyaev commented Jan 20, 2021

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