Skip to content

Package Binaries

Details about the process of installing package binaries.

Customizing Download Locations

Internally, volta install <tool> uses npm-style resolution to determine which versions are available and the download location for package binaries. Accordingly, to redirect and use an internal repository (i.e. to install an internal tool from a private repo), you can create a .npmrc file in your home directory. Options specified there will be honored when resolving and downloading a tool, as well as when resolving the dependencies of a given tool.

Pinned Node Version

As described in Understanding Volta, Volta will pin a version of Node when a tool is installed, so that the tool can continue to be used, even if the default Node version changes. The process used to determine which version should be pinned is as follows:

Prior to Volta 0.6.8

  • If the package has engines specified in package.json, use the latest version of Node that meets the requirements in engines
  • Otherwise, use the most recent version of Node

Volta 0.6.8 through Volta 0.8.7

  • If the package has engines specified in package.json, use the latest LTS version of Node that meets the requirements
  • If no LTS versions meet the requirements then use the latest overall version that satisfies engines
  • If engines isn't available, use the most recent LTS version of Node

Volta 0.9.0 and beyond

Starting with Volta 0.9.0, Volta will pin a package to your current default Node version (at the time the tool was installed). You can change that version by changing your default, or by running the install with volta run:

bash
volta run --node 15 npm i -g ember-cli

Global Package Management

When you install a global package using Volta, it creates a shim in your Volta bin directory that points to the specific version of the package you installed. This allows you to:

  1. Use the package from anywhere on your system
  2. Ensure the package always runs with the Node version it was installed with
  3. Install multiple global packages that require different Node versions

Using npm or Yarn for Global Packages

As of Volta 0.9.0, you can use standard npm or Yarn commands to manage global packages:

bash
# Install a global package with npm
npm install -g typescript

# Install a global package with Yarn
yarn global add eslint

# Uninstall a global package with npm
npm uninstall -g typescript

# Uninstall a global package with Yarn
yarn global remove eslint

Volta intercepts these commands and ensures that the packages are properly installed in the Volta ecosystem, creating the necessary shims.

Checking Installed Packages

To see which global packages are currently installed, use:

bash
volta list packages

Package Binary Resolution

When you run a package binary (like tsc for TypeScript), Volta follows these steps:

  1. Check if the binary is in a project with a local installation of the package
  2. If found locally, use that version
  3. If not found locally, use the globally installed version
  4. If not installed globally, show an error message

This resolution process ensures that you always use the correct version of a tool for each project.

Released under the BSD 2-Clause License.