meta_package_manager.managers.volta module¶

class meta_package_manager.managers.volta.Volta[source]¶

Bases: PackageManager

Volta manages JavaScript command-line tools, installing each package from the npm registry into its own isolated image pinned to a specific Node runtime.

Tools installed with volta install never land in npm’s global prefix: Volta keeps them under its own VOLTA_HOME layout and exposes their binaries through shims on PATH. The npm executable found on a Volta-equipped host is itself such a shim, and npm --global operations do not see Volta-managed tools, hence this dedicated backend (requested in #1995).

Volta has no command listing outdated packages, so outdated (and with it the synthesized upgrade --all) is unsupported: upgrades are targeted, by reinstalling the latest release of a named package.

Initialize cli_errors list.

unmaintained: bool = True¶

A manager whose upstream project is no longer maintained.

Covers projects that are officially retired and those we infer are abandoned: archived on their forge, left without a release or commit for years, formally superseded by a successor, or part of a discontinued platform. See the stability policy in CLAUDE.md for the full criteria.

An unmaintained manager is hidden from package selection by default (you can still use it by explicitly calling for it on the command line), and is exempt from the project stability policy: it may be dropped, in part or in full, in any release and without notice, once keeping it working becomes too burdensome.

Unmaintained managers are kept out of the functional and integration test matrices, so an unreliable or flaky one never blocks a release and we save CI resources. The commitment is to keep the wrapper for as long as that stays cheap: the cheap static invariants (ID format, attribute ordering, …) still apply for as long as the manager’s code lives in the source tree, to keep that code valid.

Every unmaintained manager must document itself through unmaintained_message.

unmaintained_message: str | None = "Volta's maintainers [declared the project unmaintained on 2025-11-14](https://github.com/volta-cli/volta/issues/2080) and recommend migrating to [`mise`](https://mise.jdx.dev). The final release, [`2.0.2`](https://github.com/volta-cli/volta/releases/tag/v2.0.2), dates back to 2024-12-05."¶

Evidence and rationale for the unmaintained flag, as a MyST markdown block.

Rendered into the documentation (the manager’s page, and a ⚠️ marker in the manager tables). May embed markdown links to the archival notice, the successor project, or the discontinuation announcement. Required for every manager whose unmaintained flag is set, and only meaningful on such managers. Enforced by test_unmaintained.

homepage_url: str | None = 'https://volta.sh'¶

Home page of the project, only used in documentation for reference.

platforms: frozenset[Platform] | Group | Platform | Iterable[Platform | Group] = frozenset({Platform(id='almalinux', name='AlmaLinux'), Platform(id='alpine', name='Alpine Linux'), Platform(id='altlinux', name='ALT Linux'), Platform(id='amzn', name='Amazon Linux'), Platform(id='android', name='Android'), Platform(id='arch', name='Arch Linux'), Platform(id='buildroot', name='Buildroot'), Platform(id='cachyos', name='CachyOS'), Platform(id='centos', name='CentOS'), Platform(id='chromeos', name='ChromeOS'), Platform(id='clearlinux', name='Clear Linux OS'), Platform(id='cloudlinux', name='CloudLinux OS'), Platform(id='debian', name='Debian'), Platform(id='endeavouros', name='EndeavourOS'), Platform(id='exherbo', name='Exherbo Linux'), Platform(id='fedora', name='Fedora'), Platform(id='generic_linux', name='Generic Linux'), Platform(id='gentoo', name='Gentoo Linux'), Platform(id='guix', name='Guix System'), Platform(id='ibm_powerkvm', name='IBM PowerKVM'), Platform(id='kali', name='Kali Linux'), Platform(id='kvmibm', name='KVM for IBM z Systems'), Platform(id='linuxmint', name='Linux Mint'), Platform(id='macos', name='macOS'), Platform(id='mageia', name='Mageia'), Platform(id='mandriva', name='Mandriva Linux'), Platform(id='manjaro', name='Manjaro Linux'), Platform(id='nixos', name='NixOS'), Platform(id='nobara', name='Nobara'), Platform(id='opensuse', name='openSUSE'), Platform(id='openwrt', name='OpenWrt'), Platform(id='oracle', name='Oracle Linux'), Platform(id='parallels', name='Parallels'), Platform(id='pidora', name='Pidora'), Platform(id='pikaos', name='PikaOS'), Platform(id='raspbian', name='Raspbian'), Platform(id='rhel', name='RedHat Enterprise Linux'), Platform(id='rocky', name='Rocky Linux'), Platform(id='scientific', name='Scientific Linux'), Platform(id='slackware', name='Slackware'), Platform(id='sles', name='SUSE Linux Enterprise Server'), Platform(id='slitaz', name='SliTaz GNU/Linux'), Platform(id='sourcemage', name='Source Mage GNU/Linux'), Platform(id='tuxedo', name='Tuxedo OS'), Platform(id='ubuntu', name='Ubuntu'), Platform(id='ultramarine', name='Ultramarine'), Platform(id='void', name='Void Linux'), Platform(id='windows', name='Windows'), Platform(id='wsl1', name='Windows Subsystem for Linux v1'), Platform(id='wsl2', name='Windows Subsystem for Linux v2'), Platform(id='xenserver', name='XenServer')})¶

List of platforms supported by the manager.

Allows for a mishmash of platforms and groups of platforms. Will be normalized into a frozenset of Platform instances at instantiation.

requirement: str | None = '>=1.0.2'¶

1.0.2 ships the fixes making volta list report correct information (volta-cli/volta#778 and volta-cli/volta#926), the listing this backend parses. The plain output format itself is stable from 1.0 through the final 2.0.2 release.

cli_search_path: tuple[str, ...] = ('~/.volta/bin',)¶

VOLTA_HOME/bin, where the official install script places the volta binary on Linux and macOS. Windows installers register the binary on PATH themselves.

property installed: Iterator[Package]¶

Fetch installed packages.

volta list all --format plain prints one line per tool. Only package lines carrying the (default) marker are retained: they are the globally-installed npm packages Volta manages through volta install and volta uninstall. runtime (Node) and package-manager (npm, pnpm, Yarn) lines are pinned toolchain components Volta cannot uninstall, so they are kept out of the inventory. So is a package shadowed by the working directory’s own JavaScript project: it renders with project placeholders instead of versions, so run mpm outside a project tree for the full global inventory.

The sample below is derived from the format’s unit tests in Volta’s plain.rs and the trace of #1995:

$ volta list all --format plain
runtime [email protected] (default)
package-manager [email protected] (default)
package-manager [email protected] (default)
package @larksuite/[email protected] / lark-cli / [email protected] npm@built-in (default)
package [email protected] / ember / [email protected] npm@built-in (default)
package [email protected] / tsc, tsserver / [email protected] npm@built-in (default)
cli_names: tuple[str, ...] = ('volta',)¶

List of CLI names the package manager is known as.

This list of recognized CLI names is ordered by priority. That way we can influence the search of the right binary.

..hint::

This was helpful in the case of the Python transition from 2.x to 3.x, where multiple versions of the same executable were named python or python3.

By default, this property’s value is derived from the manager’s ID (see the MetaPackageManager.__init__ method above).

id: str = 'volta'¶

Package manager’s ID.

Derived by defaults from the lower-cased class name in which underscores _ are replaced by dashes -.

This ID must be unique among all package manager definitions and lower-case, as they’re used as feature flags for the mpm CLI.

install(package_id, version=None)[source]¶

Install one package.

Volta pins exact versions natively through npm’s name@version spec syntax; a bare name resolves to the latest release.

$ volta install [email protected]
Return type:

str

name: str = 'Volta'¶

Return package manager’s common name.

Default value is based on class name.

virtual: bool = False¶

Should we expose the package manager to the user?

Virtual package manager are just skeleton classes used to factorize code among managers of the same family.

upgrade_one_cli(package_id, version=None)[source]¶

Generates the CLI to upgrade the package provided as parameter.

Volta has no dedicated upgrade command for packages: reinstalling a bare name fetches the latest release and swaps it in as the new default.

$ volta install ember-cli
Return type:

tuple[str, ...]

remove(package_id)[source]¶

Remove one package.

$ volta uninstall ember-cli
Return type:

str