DEV Community

Felipe César
Felipe César

Posted on • Edited on

Managing dependencies with Volta

In this post I will talk about Volta and why I stopped using NVM.

What is Volta?

Volta is a command-line tool that allows you to install and execute any JavaScript tool perfectly. It ensures everyone in the project has the same tools, whit same versions.

To install you just need to run a command:

# install Volta
curl https://get.volta.sh | bash
Enter fullscreen mode Exit fullscreen mode

Then, we can install any tool and use it normally:

# install Node
volta install node

# start using Node
node
Enter fullscreen mode Exit fullscreen mode

You can pin versions in your projects as well:

volta pin node yarn
Enter fullscreen mode Exit fullscreen mode

This command will add the versions in an object in package.json.

"volta": {
  "node": "12.19.0",
  "yarn": "1.22.10"
}
Enter fullscreen mode Exit fullscreen mode

If you don't have this versions, Volta will download them on the fly for you.

Why did I stop using NVM?

When I heard about Volta for the first time, I thought: I don't need that, I've already using NVM.

Even so, I decided to take a look at Volta and realised that I was wrong. With NVM I was able to managing versions of Node, with Volta I can do this for any tool.

Furthermore, NVM has some points that bothered me:

  • I always needed to change the versions manually. To automate this it was necessary to add some settings to the shell, as well as add a .nvmrc file to the project.

  • There is a delay to change versions. With Volta this change is really faster and no-additional settings is required, it does it automatically.

Conclusion

This post was a brief introduction to Volta and some pros that I see compared to NVM, if you saw another pros or cons tell me in the comments.

SurveyJS custom survey software

Build Your Own Forms without Manual Coding

SurveyJS UI libraries let you build a JSON-based form management system that integrates with any backend, giving you full control over your data with no user limits. Includes support for custom question types, skip logic, an integrated CSS editor, PDF export, real-time analytics, and more.

Learn more

Top comments (0)

Image of Docusign

🛠️ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more