How To Install node-npmrc on Ubuntu 18.04

In this tutorial we learn how to install node-npmrc on Ubuntu 18.04. node-npmrc is Switch between different .npmrc files

Introduction

In this tutorial we learn how to install node-npmrc on Ubuntu 18.04.

What is node-npmrc

node-npmrc is:

If you use a private npm registry, you know the pain of switching between a bunch of different .npmrc files and manually managing symlinks. Let that be a problem no more! npmrc is here to save the day, by making it dead simple to switch out your .npmrc with a specific named version. It also tries to protect you from your own stupid self by making sure you don’t accidentally overwrite an .npmrc that you actually want to keep.

There are three methods to install node-npmrc on Ubuntu 18.04. We can use apt-get, apt and aptitude. In the following sections we will describe each method. You can choose one of them.

Install node-npmrc Using apt-get

Update apt database with apt-get using the following command.

sudo apt-get update

After updating apt database, We can install node-npmrc using apt-get by running the following command:

sudo apt-get -y install node-npmrc

Install node-npmrc Using apt

Update apt database with apt using the following command.

sudo apt update

After updating apt database, We can install node-npmrc using apt by running the following command:

sudo apt -y install node-npmrc

Install node-npmrc Using aptitude

If you want to follow this method, you might need to install aptitude first since aptitude is usually not installed by default on Ubuntu. Update apt database with aptitude using the following command.

sudo aptitude update

After updating apt database, We can install node-npmrc using aptitude by running the following command:

sudo aptitude -y install node-npmrc

How To Uninstall node-npmrc on Ubuntu 18.04

To uninstall only the node-npmrc package we can use the following command:

sudo apt-get remove node-npmrc

Uninstall node-npmrc And Its Dependencies

To uninstall node-npmrc and its dependencies that are no longer needed by Ubuntu 18.04, we can use the command below:

sudo apt-get -y autoremove node-npmrc

Remove node-npmrc Configurations and Data

To remove node-npmrc configuration and data from Ubuntu 18.04 we can use the following command:

sudo apt-get -y purge node-npmrc

Remove node-npmrc configuration, data, and all of its dependencies

We can use the following command to remove node-npmrc configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge node-npmrc

References

Summary

In this tutorial we learn how to install node-npmrc package on Ubuntu 18.04 using different package management tools: apt, apt-get and aptitude.