Skip to content

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:

bash
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:

  1. Define VOLTA_HOME environment variable (typically set to ~/.volta)
  2. Add $VOLTA_HOME/bin to the PATH 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

bash
# Run the setup process
volta setup

This will update your shell profile files and make Volta available in your shell.

Quiet Setup

bash
# Run setup with minimal output
volta setup --quiet

When to Use

The volta setup command is useful in several scenarios:

  1. After a Fresh Installation: Run after first installing Volta
  2. After Removing Shell Configuration: If you've manually edited your shell profile and removed Volta's configuration
  3. For New Users: When setting up Volta for a new user on a system
  4. 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:

bash
export VOLTA_HOME="$HOME/.volta"
export PATH="$VOLTA_HOME/bin:$PATH"

For fish shell, it adds:

fish
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:

  1. Create the Volta home directory (defaults to ~/.volta on Unix or %LOCALAPPDATA%\Volta on Windows)
  2. Add the bin directory to your PATH environment variable
  3. Reload your shell or restart your terminal

Troubleshooting

If Volta is not available after running volta setup:

  1. Make sure you've opened a new terminal window
  2. Check that Volta's bin directory is in your PATH (echo $PATH on Unix or echo %PATH% on Windows)
  3. Verify that the Volta home directory exists
  4. For Unix systems, check that your shell profile was modified correctly

Released under the BSD 2-Clause License.