Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Cannot find module 'eslint-config-standard' #84

Closed
u3u opened this issue Jul 9, 2017 · 15 comments
Closed

Error: Cannot find module 'eslint-config-standard' #84

u3u opened this issue Jul 9, 2017 · 15 comments
Labels

Comments

@u3u
Copy link

u3u commented Jul 9, 2017

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'
@FNGR2911
Copy link

Same here. Even I try to install it myself.

Also got some weird files after running eslint --init (=2.2.0, =3.0.0, 3.5.0, etc.).

Running npm -v 5.0.3

@u3u
Copy link
Author

u3u commented Jul 13, 2017

@FNGR2911
I know the reason now, because the es-lint I implemented is global installed, so it looks for the global eslint-config-standard. Locally installed can be executed using node_modules/.bin/eslint, or the command is written in the script option of the package.json file!

@u3u u3u closed this as completed Jul 13, 2017
@Dragon-Rider
Copy link

@u3u It worked!Thanks for help!

@vigneshr23
Copy link

Hey I dont understand what is going on here.
I tried running eslint --init but the problem still persists. Can anyone help?

@cwgabel
Copy link

cwgabel commented Mar 14, 2018

@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!

@fdambrosio
Copy link

I have the same problem using firebase deploy

@feross
Copy link
Member

feross commented May 15, 2018

To fix this, ensure that eslint-config-standard and 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.

@brok3nSec
Copy link

Same here smh

@brettz9
Copy link
Contributor

brettz9 commented Nov 16, 2018

FWIW, in my case, it was using eslint-plugin-standard instead of eslint-config-standard...

@edisoncks
Copy link

In my case, eslint --init only added the dependencies to package.json but did not install them. So I have to manually run npm install for it to work.

@begueradj
Copy link

begueradj commented Jan 28, 2019

@u3u How to add node_modules/.bin/eslint to package.json script commands?
I tried:

"scripts": {
  "eslint": "node_modules/.bin/eslint "
} 

but I am getting the same error message

@j3soon
Copy link

j3soon commented Apr 9, 2019

For Windows users, try:

node_modules\.bin\eslint

@daniel2009
Copy link

How to run node_modules/.bin/eslint ? In terminal for MacOS or cmd for Windows? @u3u @j3soon

@j3soon
Copy link

j3soon commented Apr 10, 2019

@daniel2009 When you want to auto fix your errors, you might want to type:

eslint --fix --ext .js,.vue --ignore-path .gitignore .

inside your project root directory.

But instead you should type:

node_modules/.bin/eslint --fix --ext .js,.vue --ignore-path .gitignore .

or on Windows:

node_modules\.bin\eslint --fix --ext .js,.vue --ignore-path .gitignore .

@GRTO
Copy link

GRTO commented Apr 11, 2019

@daniel2009 When you want to auto fix your errors, you might want to type:

eslint --fix --ext .js,.vue --ignore-path .gitignore .

inside your project root directory.

But instead you should type:

node_modules/.bin/eslint --fix --ext .js,.vue --ignore-path .gitignore .

or on Windows:

node_modules\.bin\eslint --fix --ext .js,.vue --ignore-path .gitignore .

It worked! thanks :)

ganpeng pushed a commit to ganpeng/tianchi-media-admin that referenced this issue Jun 13, 2022
…e层的naviBarManage

Summary:
1.将原先的栏目管理更新为导航栏(naviBar)管理,将原先的栏目设置改为布局管理(layout manage),与后端保持一致;
2.增加service层的naviBarManage,调试导航栏管理接口,目前接口和数据需要跟后端继续沟通;
3.在引入其它项目的js文件时,可能会与本项目的eslint规范不符,可使用eslint --fix file 来进行修正。如果报 Cannot find module 'eslint-config-standard'错误,可以使用node_modules/.bin/eslint --fix 'file' 来操作。具体可见[[ standard/eslint-config-standard#84 | issue ]]

Test Plan: Build & run

Reviewers: binhong.wu, peng.gan

Reviewed By: peng.gan

Differential Revision: http://pha.tianchimedia.com/D230
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

No branches or pull requests