npm command not found
Introduction
When you run more command in linux terminal / console, you get the following error message
npm: command not found
or when using sudo you get the following error message
sudo: npm: command not found
Solutions to npm: command not found
How To Fix npm: command not found in Ubuntu / Debian / Kali Linux / Raspbian
In Ubuntu npm is provided by npm package.
npm is:
Node.js is an event-based server-side javascript engine.
npm is the package manager for the Node JavaScript platform. It puts modules in place so that node can find them, and manages dependency conflicts intelligently.
It is extremely configurable to support a wide variety of use cases. Most commonly, it is used to publish, discover, install, and develop node programs.
Install also node-opener to have full npm features enabled.
To fix this problem, we can install more using the command below.
sudo apt-get -y install npm
This command might take some time to finish depending on your machine internet connection.
You can also use apt command to install npm.
sudo apt -y install npm
Or if you have aptitude installed you can use the following command.
sudo aptitude install npm
Summary
In this tutorial we learn how to fix npm command not found error in Ubuntu / Debian / Kali Linux or Raspbian distribution.