npmrc command not found

In this troubleshooting guide we learn how to fix npmrc command not found error message

Introduction

When you run more command in linux terminal / console, you get the following error message

npmrc: command not found

or when using sudo you get the following error message

sudo: npmrc: command not found

Solutions to npmrc: command not found

How To Fix npmrc: command not found in Ubuntu / Debian / Kali Linux / Raspbian

In Ubuntu npmrc is provided by node-npmrc package.

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.

To fix this problem, we can install more using the command below.

sudo apt-get -y install node-npmrc

This command might take some time to finish depending on your machine internet connection.

You can also use apt command to install node-npmrc.

sudo apt -y install node-npmrc

Or if you have aptitude installed you can use the following command.

sudo aptitude install node-npmrc

Summary

In this tutorial we learn how to fix npmrc command not found error in Ubuntu / Debian / Kali Linux or Raspbian distribution.