HomeLinux5 Node.js Managers To Set up A number of Node.js Variations

5 Node.js Managers To Set up A number of Node.js Variations


Node.js model managers, also called “surroundings managers” are instruments that allow builders or system directors to set up and handle a number of Node.js variations on their computer systems or servers.

These managers are helpful since completely different tasks might require completely different variations of Node.js, and manually switching between variations may be tough.

On this article, we’ll overview the perfect model/surroundings managers out there for Node.js open-source server surroundings.

1. NVM – Node Model Supervisor

Node Model Supervisor (NVM) is a program that permits you to set up and handle a number of variations of Node.js on a single laptop or server. It lets you effortlessly change between Node.js variations and set up new variations as they turn into out there.

NVM permits you to set up and run any model of Node.js from the command line. It’s also possible to specify a default Node.js model and change to a unique model both quickly or completely.

NVM is a helpful software for builders who must work with a number of Node.js variations, significantly whereas engaged on a number of tasks that require completely different variations of Node.js. It additionally makes it easy to improve to newer Node.js variations as they turn into out there.

NVM - Node Version Manager
NVM – Node Model Supervisor

Set up NVM in Linux

To put in or replace nvm, you need to run the set up script utilizing the next cURL or Wget command:

$ curl -o- https://uncooked.githubusercontent.com/nvm-sh/nvm/v0.39.3/set up.sh | bash
OR
$ wget -qO- https://uncooked.githubusercontent.com/nvm-sh/nvm/v0.39.3/set up.sh | bash
$ supply ~/.bashrc

Subsequent, you’ll be able to record or set up the most recent Nodejs model utilizing nvm as proven.

$ nvm ls               [List Installed Node Versions]
$ nvm ls-remote        [List Available Node Version]
$ nvm set up newest   [Install Latest Node Version]
$ nvm set up vX.Y.Z   [Install Specific Node Version]

2. N – Node Model Administration

n (Node Model Administration) is one other well-known open-source Node.js model supervisor that permits builders to effortlessly change between completely different Node.js variations on their machines.

It may be put in on a wide range of working techniques, together with Linux, macOS, and Home windows, and it will possibly handle quite a few Node.js variations on the identical time.

Utilizing simple instructions in your terminal, n makes it easy to put in, change between, and handle a number of Node.js variations. It additionally helps a number of sensible capabilities, resembling putting in the newest model, switching to it, and putting in and using specific variations.

N - Node Version Management
N – Node Model Administration

Set up N in Linux

If Node.js is already put in, a straightforward approach to set up n is utilizing npm:

$ npm set up -g n

If npm just isn’t put in, you should utilize the next curl command to obtain and run n straight.

$ curl -fsSL https://uncooked.githubusercontent.com/tj/n/grasp/bin/n | bash -s lts
$ npm set up -g n

Now merely execute the next command to obtain and set up a model of Node.js.

$ n 10.16.0
$ n lts
$ n ls-remote
$ n present
$ n newest

3. fnm – Quick Node Supervisor

Quick Node Supervisor (fnm) is a command-line utility for managing a number of Node.js variations on a single system. It allows builders to easily change between a number of Node.js variations and offers a straightforward means to put in, handle, and change.

Fnm is developed with the Node.js runtime, making it easy to make use of and set up. It might be put in and used on Home windows, macOS, and Linux. Fnm operates by downloading and managing quite a few variations of Node.js in a consumer’s residence listing, in addition to creating symbolic hyperlinks to change between them.

Moreover, fnm affords help for a number of Node.js distribution channels, computerized set up of Node.js and npm packages, and the flexibility to put in pre-releases and different unstable Node.js variations.

fnm - Fast Node Manager
fnm – Quick Node Supervisor

Set up Fnm in Linux

To put in fnm, obtain and set up the automated set up script as proven.

$ curl -fsSL https://fnm.vercel.app/set up | bash

Subsequent, record, set up, and think about the present Node.js model as proven.

$ fnm record
$ fnm set up
$ fnm present

4. asdf – Node.js Model Administration Device

asdf is a model administration software for a lot of completely different programming languages, together with Node.js. You’ll be able to commute between them as obligatory. It lets you set up and handle varied Node.js variations in your PC.

In the event you work on a number of tasks which every require a separate Node.js model, asdf may be useful. As quickly as you navigate to the listing for a mission, asdf will routinely set the suitable Node.js model for you based mostly on the model you specified for that mission.

Every Node.js model is put in by asdf in a unique listing in your laptop, and once you transfer to a mission that wants it, symlinks are made to level to the right model. This makes switching between variations easy since nothing must be explicitly configured or reinstalled.

asdf - Nodejs Management Tool
asdf – Nodejs Administration Device

Set up asdf in Linux

To put in asdf, clone the git repository as proven.

$ git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.11.3

Subsequent, add the next to ~/.bashrc file.

. "$HOME/.asdf/asdf.sh"
. "$HOME/.asdf/completions/asdf.bash"

After including $PATH to the ~/.bashrc file, ensure that to supply it as proven.

$ supply .bashrc

Subsequent, set up the plugin by operating:

$ asdf plugin add nodejs https://github.com/asdf-vm/asdf-nodejs.git

As soon as we’ve got a plugin, we are able to set up a Node.js model as proven.

$ asdf record all nodejs
$ asdf set up nodejs newest

5. Volta

Volta is a Node.js model supervisor that makes it easy to maneuver between varied Node.js variations in your laptop. It’s designed to be quick, reliable, and straightforward to make use of.

With Volta, you’ll be able to arrange and use a number of variations, switching between them routinely relying on the mission you’re engaged on. This makes testing your code with varied Node.js variations and sustaining constant environments throughout a number of tasks easy.

Moreover, Volta integrates with different instruments utilized in your improvement processes, resembling npm and yarn bundle administration.

Volta - NodeJS Tool Manager
Volta – NodeJS Device Supervisor

Set up Volta on Linux

On most Linux techniques you’ll be able to set up Volta with a single command:

$ curl https://get.volta.sh | bash

As soon as we’ve got Volta, we are able to set up the most recent Node.js model as proven.

$ volta set up node
$ volta set up [email protected]

The aforementioned Node.js model/surroundings managers give builders and system directors further flexibility and stability when managing their Node.js tasks.

Use the shape under to share your feedback relating to this text.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments