Installing and Updating Tools
Volta makes it easy to install and manage JavaScript tools across your system and projects.
Installing Node.js
Default Node Version
To install Node.js as your default version:
volta install nodeThis command installs the latest LTS (Long-Term Support) version of Node.js. To install a specific version:
volta install node@16
volta install node@16.14.2You can also use version ranges:
volta install node@16.14
volta install node@^16.14Project-Specific Node Version
To pin a specific Node.js version to your project:
volta pin node@16.14.2This adds a volta section to your package.json file:
{
"volta": {
"node": "16.14.2"
}
}Managing Package Managers
Default Package Manager
To set a default package manager:
volta install npm@8
volta install yarn@1.22
volta install pnpm@7Project-Specific Package Manager
To pin a package manager version to your project:
volta pin npm@8
volta pin yarn@1.22This updates your package.json:
{
"volta": {
"node": "16.14.2",
"npm": "8.5.0"
}
}Global Packages
Installing Global Tools
To install a global JavaScript package:
volta install typescript
volta install eslintFor specific versions:
volta install typescript@4.6.3Viewing Installed Tools
To see what tools you have installed:
volta list allTo see only specific types of tools:
volta list node
volta list npm
volta list yarn
volta list packagesUpdating Tools
Updating Global Tools
To update a global package to the latest version:
volta install typescript@latestUpdating Project Tools
To update a project-specific tool:
volta pin node@latest
volta pin npm@latestUninstalling Tools
To uninstall a global package:
volta uninstall typescriptTo uninstall a default tool:
volta uninstall node
volta uninstall npmNote: This doesn't remove the tool from your system if it's needed by a project.