Cannot find module 'eslint-config-airbnb' and/or 'eslint-plugin-react'
See original GitHub issueI’ve been trying to solve this for a couple of days and well… I wouldn’t be asking if I fixed it 😄.
Cannot read config package: eslint-config-airbnb Error: Cannot find module ‘eslint-config-airbnb’ Referenced from: long_path.eslintrc
Cannot read config package: eslint-plugin-react Error: Cannot find module ‘eslint-plugin-react’ Referenced from: long_path.eslintrc
I deleted every package from global (except for webpack and webpack-dev-server).
I ran npm i eslint eslint-plugin-react eslint-config-airbnb babel-eslint -D
and all of them appear in node_modules
and package.json
.
If I run node_modules\.bin\eslint file_name.jsx
the command works just fine, using both the plugin and the config.
packages.json
"devDependencies": {
"babel-core": "^6.6.5",
"babel-eslint": "^5.0.0",
"babel-loader": "^6.2.4",
"babel-preset-es2015": "^6.6.0",
"babel-preset-react": "^6.5.0",
"chai": "^3.5.0",
"chai-immutable": "^1.5.3",
"eslint": "^2.3.0",
"eslint-config-airbnb": "^6.1.0",
"eslint-plugin-react": "^4.2.1",
"file-loader": "^0.8.5",
"jsdom": "^8.1.0",
"mocha": "^2.4.5",
"path": "^0.12.7",
"react-hot-loader": "^1.3.0",
"url-loader": "^0.5.7",
"webpack": "^1.12.14",
"webpack-dev-server": "^1.14.1"
},
.eslintrc
"parser": "babel-eslint",
"plugins": ["react"],
"ecmaFeatures": {
"jsx": true
},
"env": {
"browser": true,
"node": true
},
"extends": "airbnb",
Any tips on debugging this?
Issue Analytics
- State:
- Created 8 years ago
- Reactions:21
- Comments:35 (15 by maintainers)
Top Results From Across the Web
eslint in terminal Cannot find module 'eslint-config-react-app'
First install this package, ESLint and the necessary plugins. npm install --save-dev eslint-config ...
Read more >Using globally installed "standard" package causes "Cannot ...
Using globally installed "standard" package causes "Cannot find module 'eslint-plugin-react'" error · npm install standard@14.3.1 -g · create a new project, ...
Read more >eslint/eslint - Gitter
This can happen for a couple different reasons: 1. If ESLint is installed globally, then make sure eslint-plugin-jsx-a11y is also installed globally. A...
Read more >eslint-config-airbnb - npm
This entry point enables the linting rules for React hooks (requires v16.8+). To use, add "extends": ["airbnb", "airbnb/hooks"] to your .
Read more >Cannot find module 'eslint-config-airbnb-base' #10388
Hi Mehdi, If you are running ESLint globally, then you need to install your plugins globally too. We typically recommend installing ESLint locally...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Quitting VSCode and opening it again fixed this issue for me.
I was facing the same issue, probably because of eslint installation, eslint was installed globally on my system and all dependencies were installed as dev-dependency. so what I did, simply removed the eslint from global
npm uninstall -g eslint
and install eslint locallynpm i eslint --save-dev
then run this(mac or Linux)
./node_modules/.bin/eslint --init
for windows
.\node_modules\.bin\eslint --init
hope this will fix your problem