volta setup
The volta setup
command will enable Volta by modifying the PATH
for the current user (in a platform-dependent way) to include the Volta shim directory. It has the following syntax:
Enables Volta for the current user
USAGE:
volta setup [FLAGS]
FLAGS:
--verbose Enables verbose diagnostics
--quiet Prevents unnecessary output
-h, --help Prints help information
Unix Setup
On Unix systems (macOS and Linux), volta setup
will search for profile scripts using the following list:
~/.profile
~/.bash_profile
~/.bashrc
~/.zshrc
~/.config/fish/config.fish
- The value of the
PROFILE
environment variable
For each of these files that exist, volta setup
will modify it to include lines that:
- Define
VOLTA_HOME
environment variable (typically set to~/.volta
) - Add
$VOLTA_HOME/bin
to thePATH
environment variable
If the configuration file for your current shell (detected using the $SHELL
environment variable) doesn't exist, it will be created with the appropriate contents, if possible.
Windows Setup
On Windows, volta setup
will modify the User Path
environment variable to include the shim directory (%LOCALAPPDATA%\Volta\bin
). This ensures that Volta commands are available in all command prompts.
Examples
Basic Setup
# Run the setup process
volta setup
This will update your shell profile files and make Volta available in your shell.
Quiet Setup
# Run setup with minimal output
volta setup --quiet
When to Use
The volta setup
command is useful in several scenarios:
- After a Fresh Installation: Run after first installing Volta
- After Removing Shell Configuration: If you've manually edited your shell profile and removed Volta's configuration
- For New Users: When setting up Volta for a new user on a system
- After Shell Changes: If you've switched to a different shell
What Setup Adds to Your Profile
For bash/zsh/sh, volta setup
adds lines similar to:
export VOLTA_HOME="$HOME/.volta"
export PATH="$VOLTA_HOME/bin:$PATH"
For fish shell, it adds:
set -gx VOLTA_HOME "$HOME/.volta"
set -gx PATH "$VOLTA_HOME/bin" $PATH
Manual Setup
If you prefer not to use volta setup
, you can manually add Volta to your PATH:
- Create the Volta home directory (defaults to
~/.volta
on Unix or%LOCALAPPDATA%\Volta
on Windows) - Add the bin directory to your PATH environment variable
- Reload your shell or restart your terminal
Troubleshooting
If Volta is not available after running volta setup
:
- Make sure you've opened a new terminal window
- Check that Volta's bin directory is in your PATH (
echo $PATH
on Unix orecho %PATH%
on Windows) - Verify that the Volta home directory exists
- For Unix systems, check that your shell profile was modified correctly