Volta - node version manager on steroids
Installation
curl https://get.volta.sh | bash
This will install volta
library under ~/.volta
directory and also update your ~/.bashrc
, ~/.zshrc
and ~/.config/fish
Script will add bin
directory to path, something like
export VOLTA_HOME="$HOME/.volta"
export PATH="$VOLTA_HOME/bin:$PATH"
Uninstallation
You have to manually remove volta
references from your system.
- Remove
volta
from path from your bash or zsh config (~/.bashrc
and / or~/.zshrc
) - Removed
~/.volta
folder.rm -rf ~/.volta
Volta Commands
fetch Fetches a tool to the local machine
install Installs a tool in your toolchain
uninstall Uninstalls a tool from your toolchain
pin Pins your project's runtime or package manager
list Displays the current toolchain
completions Generates Volta completions
which Locates the actual binary that will be called by Volta
setup Enables Volta for the current user / shell
help Prints this message or the help of the given subcommand(s)
Install node engines
You have to install node using volta install
command. You can install as many node versions as you like.
Install latest LTS release
volta install node
Install specific version
volta install node@12
volta install node@12.2.0
Package manager to install local dependencies (package.json)
volta install npm
volta install yarn
Pinning Node engines for your project
To use specific node or npm version for your project use pin
command. It will update your package.json file.
volta pin node@12.2.0
volta pin npm@6.14.8
package.json
...
"volta": {
"node": "11.14.0",
"npm": "6.14.8"
}
...
Global packages
To install global packages (similar to npm install -g
) use install
or fetch
commands
To uninstall global packages (similar to npm uninstall -g
) use uninstall
command.
e.g.
volta install surge
volta fetch surge
volta uninstall surge
install - install and set the default version of tool
fetch - fetch tool locally without setting it as default
neovim
You have to update node host in init.vim
for neovim
let g:node_host_prog = system('volta which neovim-node-host | tr -d "\n"')
- For for information visit volta.sh
Top comments (6)
I would suggest using asdf instead. It's all in one multiple runtime version manager. dev.to/mainendra/asdf-what--2p20
Wondering if you recommend to uninstall nvm while using volta?
You don't need to uninstall nvm but if you want you can. Volta installer will update your bashrc or zshrc to use node installed by volta. It will override node path installed by nvm.
$ npm rm -g volta
up to date, audited 1 package in 63ms
found 0 vulnerabilities
~ ⌚ 17:16:52
$ yarn rm -g volta
zsh: command not found: yarn
~ ⌚ 17:16:58
$ brew uninstall volta
Uninstalling /opt/homebrew/Cellar/volta/1.0.8... (12 files, 13.5MB)
~ ⌚ 17:17:06
$ volta
zsh: command not found: volta
~ ⌚ 17:17:11
$
Maybe I missed this but does this work on windows?
I’ve not tried on windows but it has windows installer that you might want to try 😬
docs.volta.sh/guide/getting-started