← 返回命令列表

Linux command

volta 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Install Node version

volta install node@[18]

Install specific version

volta install node@[18.17.0]

Install npm version

volta install npm@[9]

Install yarn

volta install yarn

Pin Node version for project

volta pin node@[18]

List installed tools

volta list

Show current versions

volta which node

Fetch without installing

volta fetch node@[20]

说明

volta manages JavaScript tool versions. It handles Node.js, npm, and Yarn with fast, reliable switching. Pin configuration stores versions in package.json. When entering a project directory, Volta automatically uses pinned versions. Installation is fast. Volta downloads pre-built binaries and caches them. Switching versions is instant. The shim system intercepts node, npm, and npx commands. It routes to the correct version based on project configuration. Global packages work correctly across Node versions. Volta manages them separately from Node installations. Zero configuration is needed after setup. Version switching happens transparently based on project requirements.

参数

install _TOOL_
Install tool.
pin _TOOL_
Pin tool version for project.
uninstall _TOOL_
Remove tool.
list _all_
List installed tools.
fetch _TOOL_
Download without installing.
run _TOOL_
Run tool.
which _TOOL_
Show tool path.
setup
Configure shell.
--quiet
Suppress output.
--verbose
Verbose output.
--version
Show version.

FAQ

What is the volta command used for?

volta manages JavaScript tool versions. It handles Node.js, npm, and Yarn with fast, reliable switching. Pin configuration stores versions in package.json. When entering a project directory, Volta automatically uses pinned versions. Installation is fast. Volta downloads pre-built binaries and caches them. Switching versions is instant. The shim system intercepts node, npm, and npx commands. It routes to the correct version based on project configuration. Global packages work correctly across Node versions. Volta manages them separately from Node installations. Zero configuration is needed after setup. Version switching happens transparently based on project requirements.

How do I run a basic volta example?

Run `volta install node@[18]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does install _TOOL_ do in volta?

Install tool.