volta install
The volta install
command will set your default version of a tool. It will also fetch that tool if it isn't already cached locally. It has the following syntax:
bash
Installs a tool in your toolchain
USAGE:
volta install [FLAGS] <tool[@version]>...
FLAGS:
--verbose Enables verbose diagnostics
--quiet Prevents unnecessary output
-h, --help Prints help information
ARGS:
<tool[@version]>... Tools to install, like `node`, `yarn@latest` or `your-package@^14.4.3`.
Examples
Installing Node.js
bash
# Install latest LTS version of Node as your default
volta install node
# Install specific Node version
volta install node@16.14.2
# Install using semver range
volta install node@16
volta install node@^16.14
Installing Package Managers
bash
# Install latest npm
volta install npm
# Install specific yarn version
volta install yarn@1.22.19
# Install pnpm (with feature flag enabled)
VOLTA_FEATURE_PNPM=1 volta install pnpm
Installing Global Packages
bash
# Install latest TypeScript
volta install typescript
# Install specific package version
volta install eslint@8.15.0
# Install multiple packages at once
volta install prettier typescript eslint
What Happens When You Install
When you run volta install
:
- Volta downloads the tool (if not already cached locally)
- Sets it as your default version for that tool
- Creates shims that allow you to use the tool from anywhere on your system
Unlike volta fetch
, installing a tool makes it available in your PATH through Volta's shim system. This means you can use the tool from any directory on your system.
System Impact
volta install node
affects the default Node version used outside of projects with pinned versionsvolta install yarn
sets the default package manager when no project-specific version is specified- Global package binaries installed with
volta install
are available in your PATH
To view your currently installed tools, use the volta list
command.