What is version manager

To run code in any language, you need to install its interpreter (or compiler). Different operating systems do it differently: some use package managers, for example, apt or yum , and some download the installer directly from the repository. Some languages ​​come preinstalled with operating systems, for example, Python.

$ sudo apt install <package name> # Installs most recent version

The standard installation method works well only at the very beginning when the initial setup takes place. Then, over time, different problems begin to start. For example, at some point, a new version of the language comes out and the project you are working on requires the latest version. 

Usually, it will take some time before the language becomes available for installation through package managers. And here you either have to wait, which is not always desirable or look for another installation method. The latter often takes research and a lot of time, with hours of googling and installing additional libraries. All this eventually clogs the system and sometimes breaks it.

Another serious problem arises when a developer requires different versions of the same language for different programs. This gives birth to the requirement for a version manager.

Version Manager

To solve these problems, the developers came up with version managers. A version manager is a special program designed to manage versions of a language. With its help, the required versions are installed and switched between them. Unlike the package managers that come with operating systems, version managers always allow you to install the latest versions of languages ​​as soon as they come out (including installing alpha and beta versions).

For example, you can use pyenv to manage python versions or environment or NVM for node.js.

$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
# Installation does not mean activation. After installation, the version that was before installation will remain active
$ nvm install node # Install the latest available version of the node
$ nvm install <version>
$ nvm ls-remote # list of available versions
$ nvm use node # Activate the last installed version of the node
$ nvm use node <version> # Activate the required version

To simplify the work, version managers usually allow you to create a special file within the project that captures the desired version of the language. In some cases, version managers track this file and switch versions automatically.

In the current world it’s hard to imagine a language without version manager. Below are some of the widely used languages with their version managers.