eslint-config-standard: Error: Cannot find module 'eslint-config-standard'
eslint -v
v4.2.0
eslint --init
? How would you like to configure ESLint?
Answer questions about your style
❯ Use a popular style guide
Inspect your JavaScript file(s)
? Which style guide do you want to follow?
Google
Airbnb
❯ Standard
? What format do you want your config file to be in? (Use arrow keys)
❯ JavaScript
YAML
JSON
.eslintrc
{
"extends": "standard"
}
run eslint error
$ eslint app.js
Cannot find module 'eslint-config-standard'
Referenced from: /xxx/.eslintrc
Error: Cannot find module 'eslint-config-standard'
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 16
- Comments: 15 (2 by maintainers)
@FNGR2911 I know the reason now, because the
es-lintI implemented is global installed, so it looks for the globaleslint-config-standard. Locally installed can be executed usingnode_modules/.bin/eslint, or the command is written in thescriptoption of thepackage.jsonfile!To fix this, ensure that
eslint-config-standardand all the other dependencies listed in the readme, are all installed locally, or all installed globally.It’s preferred to install all of them locally rather than globally. Check that they’re all listed in
package.json.@vigneshr23, I’m running eslint 4.18.2 on node 9.2.1 and npm 5.5.1 . I was able to run eslint globally by doing this:
npm install eslint-config-standard -g
Then try again, you’ll most likely get more errors but they come with instructions to install more packages.
Happy linting!
Hey I dont understand what is going on here. I tried running
eslint --initbut the problem still persists. Can anyone help?@daniel2009 When you want to auto fix your errors, you might want to type:
inside your project root directory.
But instead you should type:
or on Windows:
@u3u It worked!Thanks for help!