eslint command not found

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

Introduction

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

eslint: command not found

or when using sudo you get the following error message

sudo: eslint: command not found

Solutions to eslint: command not found

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

In Ubuntu eslint is provided by eslint package.

eslint is:

ESLint is a tool for identifying and reporting on patterns found in ECMAScript/JavaScript code. In many ways, it is similar to JSLint and JSHint with a few exceptions:

  • ESLint uses Espree for JavaScript parsing
  • ESLint uses an AST to evaluate patterns in code
  • ESLint is completely pluggable, every single rule is a plugin and you can add more at runtime

Some uses of ESLint require additional packages:

  • Use of parsers other than the default (Espree) require that parser, e.g. node-babel-eslint, node-esprima, or node-esprima-fb.
  • Output format “code-frame” requires node-babel-code-frame.
  • Output format “table” requires node-table and node-pluralize.

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

sudo apt-get -y install eslint

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

You can also use apt command to install eslint.

sudo apt -y install eslint

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

sudo aptitude install eslint

Summary

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