Last updated: 06.07.2024
Installing Node.js with Volta.sh
In this blog post, we will learn how to install Node.js with Volta.sh and how to use it to manage multiple Node.js versions and global packages.
What is Volta.sh?
Volta.sh is a command-line tool that allows you to easily manage multiple Node.js versions and global packages. It provides a simple and intuitive interface for installing, updating, and managing Node.js versions, as well as managing global packages.
How to install Volta.sh
Install on Unix-based systems (Linux, macOS, etc.)
To install Volta.sh on Unix-based systems, you can use the following command:
or Bash , zsh, and fish, this installer will automatically update your console startup script. If you wish to prevent modifications to your console startup script, see Skipping Volta Setup on the Volta Website. To manually configure your shell to use Volta, edit your console startup scripts to:
- Set the VOLTA_HOME variable to $HOME/.volta
- Add $VOLTA_HOME/bin to the beginning of your PATH variable
Install on Windows
To install Volta.sh on Windows, you can use the following installer: Volta.sh Installer
Volta's functionality depends on creating symlinks, so you must either:
- Enable Developer Mode (recommended)
- Run Volta with elevated privileges (not recommended)
How to use Volta.sh
Once you have installed Volta.sh, you can use it to manage multiple Node.js versions and global packages. Here are some of the key features of Volta.sh:
Installing Node.js Versions
To install a specific Node.js version, you can use the volta install
command followed by the version number. For example, to install Node.js version 16.14.2, you can run the following command:
or to install the latest version of Node.js, you can run the following command:
Install multiple Node.js versions
To install multiple Node.js versions, you can use the volta install
command multiple times. For example, to install Node.js versions 16.14.2 and 18.16.0, you can run the following command:
Updating Node.js Versions
To update a specific Node.js version, you can use the volta update
command followed by the version number. For example, to update Node.js version 16.14.2, you can run the following command:
Updating all Node.js Versions
To update all Node.js versions, you can use the volta update
command without any arguments. For example, to update all Node.js versions, you can run the following command:
Uninstalling Node.js Versions
To uninstall a specific Node.js version, you can use the volta uninstall
command followed by the version number. For example, to uninstall Node.js version 16.14.2, you can run the following command:
Uninstalling all Node.js Versions
To uninstall all Node.js versions, you can use the volta uninstall
command without any arguments. For example, to uninstall all Node.js versions, you can run the following command:
Managing Global Packages
To manage global packages, you can use the volta global
command followed by the package name and version. For example, to install the typescript
package globally, you can run the following command:
To update a global package, you can use the volta global update
command followed by the package name. For example, to update the typescript
package globally, you can run the following command:
To uninstall a global package, you can use the volta global remove
command followed by the package name. For example, to uninstall the typescript
package globally, you can run the following command:
Managing Local Packages
To manage local packages, you can use the volta local
command followed by the package name and version. For example, to install the typescript
package locally, you can run the following command:
To update a local package, you can use the volta local update
command followed by the package name. For example, to update the typescript
package locally, you can run the following command:
To uninstall a local package, you can use the volta local remove
command followed by the package name. For example, to uninstall the typescript
package locally, you can run the following command:
Managing Node.js Versions with Volta.sh
Volta.sh allows you to easily manage multiple Node.js versions and global packages. Here are some of the key features of Volta.sh:
Use a specific Node.js version
To use a specific Node.js version, you can use the volta use
command followed by the version number. For example, to use Node.js version 16.14.2, you can run the following command:
Use in a project directory a specific Node.js version
To use a specific Node.js version in a project directory, you can use the volta use
command followed by the version number and the path to the project directory. For example, to use Node.js version 16.14.2 in the /path/to/project
directory, you can run the following command:
Use the latest version of Node.js
To use the latest version of Node.js, you can use the volta use
command without any arguments. For example, to use the latest version of Node.js, you can run the following command:
Use a specific Node.js version in a project directory
To use a specific Node.js version in a project directory, you can use the volta use
command followed by the version number and the path to the project directory. For example, to use Node.js version 16.14.2 in the /path/to/project
directory, you can run the following command:
Use the latest version of Node.js
To use the latest version of Node.js, you can use the volta use
command without any arguments. For example, to use the latest version of Node.js, you can run the following command: