Skip to content

pnpm Support

Support for pnpm is currently experimental. To enable it, ensure that the environment variable VOLTA_FEATURE_PNPM is set to 1. On Windows, this can be added to your user or system environment variables in the System Settings. On Linux/Mac, you can set the value inside of your profile script (e.g. .bash_profile, .zshrc, or similar).

As this support is experimental, there may be some outstanding issues. Some of the known limitations are listed below, however if you run into anything while using pnpm with Volta that doesn't work the way you would expect, please open an issue on our GitHub.

Known Limitations

Global Installations

Currently, global installations (e.g. pnpm install -g) are not supported and will result in an error.

Migrating

There is no automatic migration at the moment, so if you previously had pnpm installed as a Volta global, you will need to manually re-install it by calling volta install pnpm. Before enabling the support and doing the re-install, you may uninstall the previously installed pnpm package via volta uninstall pnpm. Once you switch to the native pnpm support, you may not remove the isolated old pnpm package by calling the same command because lack of uninstall implementation as of now.

Enabling pnpm Support

On Unix (Linux/macOS)

Add the following line to your shell profile (.bashrc, .zshrc, etc.):

bash
export VOLTA_FEATURE_PNPM=1

Then reload your shell or run:

bash
source ~/.bashrc  # or your specific profile file

On Windows

  1. Open the Start menu and search for "Environment Variables"
  2. Click on "Edit the system environment variables"
  3. In the System Properties window, click on "Environment Variables"
  4. Under "User variables", click "New"
  5. Enter "VOLTA_FEATURE_PNPM" as the variable name and "1" as the value
  6. Click "OK" to close all dialogs

Using pnpm with Volta

Once you've enabled pnpm support, you can:

  1. Install pnpm as your default package manager:
bash
volta install pnpm
  1. Pin a specific pnpm version in a project:
bash
volta pin pnpm@7.14.0
  1. See installed pnpm versions:
bash
volta list pnpm

Troubleshooting

If you encounter issues with pnpm in Volta:

  1. Verify the feature flag is set correctly:

    • On Unix: echo $VOLTA_FEATURE_PNPM
    • On Windows: echo %VOLTA_FEATURE_PNPM%
  2. Check if pnpm is properly installed:

    • Run volta list to see if pnpm appears in the list
  3. For any other issues, please report them on the Volta GitHub repository.

Released under the BSD 2-Clause License.