volta which
The volta which command locates the actual binary that will be called by Volta. It has the following syntax:
bash
Locates the actual binary that will be called by Volta
USAGE:
volta which [FLAGS] <binary>
FLAGS:
--verbose Enables verbose diagnostics
--quiet Prevents unnecessary output
-h, --help Prints help information
ARGS:
<binary> The binary to find, e.g. `node`, `npm`, `yarn`, `npx`, or a package binaryExamples
Finding Node.js Binary
bash
# Find the location of the Node.js binary
volta which nodeThis might output something like:
/Users/username/.volta/tools/image/node/14.17.0/bin/nodeFinding Package Manager Binaries
bash
# Find the location of npm
volta which npm
# Find the location of yarn
volta which yarn
# Find the location of npx
volta which npxFinding Package Binaries
If you've installed a global package with Volta, you can find its binary:
bash
# Find the location of the typescript compiler
volta which tsc
# Find the location of eslint
volta which eslintUse Cases
The volta which command is useful when you need to:
- Determine the exact binary that Volta will execute when you run a command
- Debug issues related to tool resolution
- Use a tool's binary path in a script or configuration
- Understand how Volta resolves tools in your current project or environment
How It Works
When you run volta which, Volta performs the same resolution process it uses when you run a command:
- If you're in a project with pinned tools, it finds that specific version
- Otherwise, it uses your default version
- It returns the path to the exact binary that would be executed
The volta which command works with:
- Node.js runtime (
node) - Package managers (
npm,yarn,pnpm) - Package manager executables (
npx) - Package binaries installed globally or in the current project
Differences from Unix which
While similar to the Unix which command, volta which is specifically designed to work with Volta's tool resolution:
- It understands project-level pinning
- It accounts for Volta's shim system
- It shows the actual binary location, not just the shim
When you run a command like node, you're actually running Volta's shim, which in turn executes the correct binary. volta which shows you the path to that binary.