nodejs command not found
Introduction
When you run more command in linux terminal / console, you get the following error message
nodejs: command not found
or when using sudo you get the following error message
sudo: nodejs: command not found
Solutions to nodejs: command not found
How To Fix nodejs: command not found in Ubuntu / Debian / Kali Linux / Raspbian
In Ubuntu nodejs is provided by nodejs package.
nodejs is:
Node.js is a platform built on Chrome’s JavaScript runtime for easily building fast, scalable network applications. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices.
Node.js is bundled with several useful libraries to handle server tasks:
System, Events, Standard I/O, Modules, Timers, Child Processes, POSIX, HTTP, Multipart Parsing, TCP, DNS, Assert, Path, URL, Query Strings.
To fix this problem, we can install more using the command below.
sudo apt-get -y install nodejs
This command might take some time to finish depending on your machine internet connection.
You can also use apt command to install nodejs.
sudo apt -y install nodejs
Or if you have aptitude installed you can use the following command.
sudo aptitude install nodejs
Summary
In this tutorial we learn how to fix nodejs command not found error in Ubuntu / Debian / Kali Linux or Raspbian distribution.