question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Terminal not recognizing ESLint as a command

See original GitHub issue

2017 MacBook 12", macOS Sierra 10.12.6

  • ESLint Version: 4.19.1
  • Node Version: 10.4.1
  • npm Version: 6.1.0

What parser (default, Babel-ESLint, etc.) are you using?

Default

Please show your full configuration:

No config. Issues at install.

What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.

No source.

eslint --init

What did you expect to happen? ESLint should have made a local configuration.

What actually happened? Please include the actual, raw output from ESLint.

-bash: eslint: command not found

This is the weird part. ESLint shows that it’s fully installed and up and running:

[Info  - 12:27:03] ESLint server is running.
[Info  - 12:27:04] ESLint library loaded from: /fakepath/node_modules/eslint/lib/api.js
[Warn  - 12:27:04] 
No ESLint configuration (e.g .eslintrc) found for file: /fakepath/index.js
File will not be validated. Consider running 'eslint --init' in the workspace folder Workspace
Alternatively you can disable ESLint by executing the 'Disable ESLint' command.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

14reactions
jukebox017commented, Jun 28, 2018

You can run commands in node_modules using npx:

npx eslint --init

https://stackoverflow.com/a/45164863

1reaction
platinumazurecommented, Jun 20, 2018

Hmm. npm install --save eslint would have made the binary available only under ./node_modules/.bin/eslint (relative to your project root), so eslint shouldn’t have worked. But a global install should have made it work.

Can you run ESLint on the command line? If so, the problem is with your VSCode configuration…

Read more comments on GitHub >

github_iconTop Results From Across the Web

'eslint' is not recognized as an internal or external command
'eslint' is not recognized as an internal or external command · 2. Use npm ls -g to get the location where your globals...
Read more >
Command Line Interface - ESLint - Pluggable JavaScript Linter
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >
eslint work in terminal but doesn't show errors highlighted in ...
It runs in terminal when doing. eslint src/. but in vscode error are not highlighted or shown! my configuration file .eslintrc.js.
Read more >
ESLint not working in VSCode – possible fixes - LinuxPip
1 Run npm install? · 2 Restart VSCode · 3 Install ESLint + Plugins + Presets? · 4 Make sure ESLint work for...
Read more >
ESLint not working in VSCode? Help build a troubleshooting ...
The ESLint plugin requires permission to execute the local ESLint installation from your node_modules . Open the command palette ( Ctrl ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found