node command not found

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

Introduction

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

node: command not found

or when using sudo you get the following error message

sudo: node: command not found

Solutions to node: command not found

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

In Ubuntu node 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 node command not found error in Ubuntu / Debian / Kali Linux or Raspbian distribution.