0

I have tried using 'eslint' is not recognized as an internal or external command

And have successfully created .eslintrc.json

and the output of file is

{ "extends": "google" }

But while running cmd eslint app.js, it is giving me an error

'eslint' is not recognized as an internal or external command, operable program or batch file

Also I tried running command "./node_modules/.bin/eslint app.js" in the folder but it is giving me error "'.' is not recognized as an internal or external command, operable program or batch file"

System Info PC: WINDOWS

How to resolve this?

4
  • Possible duplicate of 'eslint' is not recognized as an internal or external command Commented Jul 29, 2018 at 13:56
  • Yes but i tried with the solution given on that question, but it still not working for me @melpomene Commented Jul 29, 2018 at 14:00
  • How did you install eslint? Is it in your package.json or did you install it globally with npm install -g eslint? Commented Jul 30, 2018 at 17:26
  • I installed it globally as well as node node_modules\eslint\bin\eslint.js --init @btmills Commented Jul 30, 2018 at 18:45

2 Answers 2

1

I got the solution, but don't know why this happens to me.

Solution:

I added the script in package.json

"scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "start": "set DEBUG=* & node app.js",
    "lint": "./node_modules/.bin/eslint app.js"
 }

and run command npm run lint in terminal and it start working.

Hope it will work for others also, who get the same error

Sign up to request clarification or add additional context in comments.

2 Comments

That solved the problem as i have added script: { "lint": "./node_modules/.bin/eslint app.js" }
npm run lint might but does eslint
0

my eslintrc file is just

.eslintrc 

without the .json

env = vs code with eslint rc installed globally

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.