Error: Failed to load plugin react: Cannot find module 'eslint-plugin-react'
at Function.Module._resolveFilename (module.js:326:15)
at Function.Module._load (module.js:277:25)
at Module.require (module.js:354:17)
at require (internal/module.js:12:17)
at Object.module.exports.load (/Users/iradchenko/sandbox/core/node_modules/eslint/lib/config/plugins.js:116:26)
at Array.forEach (native)
at Object.module.exports.loadAll (/Users/iradchenko/sandbox/core/node_modules/eslint/lib/config/plugins.js:134:21)
at processText (/Users/iradchenko/sandbox/core/node_modules/eslint/lib/cli-engine.js:158:17)
at processFile (/Users/iradchenko/sandbox/core/node_modules/eslint/lib/cli-engine.js:227:18)
at executeOnFile (/Users/iradchenko/sandbox/core/node_modules/eslint/lib/cli-engine.js:602:23)
Not sure why I'd need to install this, since I'm not using react. Seems like a dep is missing somewhere..
Can you try deleting your node_modules folder and re-installing everything?
Also, what version of node are you using?
Tried that, same result. I'm using node 4.2.6 and npm 2.14.12.
It does work in Node 5.6
Can you run ./node_modules/.bin/snazzy --version and paste the result?
Also, can you share if you're also depending on eslint or standard separately, in addition to snazzy in your package.json?
6.0.5 for the command. Yes I also have
@feross any ideas?
Use install location of standard as eslint `cwd`
Since you're depending directly on eslint, npm2 is not bothering to install eslint into standard's node_modules folder. So when standard does require('eslint') it's getting the top-level copy of eslint. That's usually not a problem, and happens all the time with npm.
But, it causes problems when eslint goes to require('eslint-plugin-react)inside of snazzy. Becauseeslintis hoisted out to the top level, it's not going to findeslint-plugin-reactwhere it lives inside ofsnazzy/node_modules/standard/node_modules/eslint-plugin-react`.
inside of snazzy. Because
is hoisted out to the top level, it's not going to find
where it lives inside of
Quick fix for you is to also install eslint-plugin-react at the top-level.
PRs for the real fix are here: Flet/standard-engine#73 feross/standard#427
Released as standard 6.0.6.
Fix confirmed, just reran the build (reinstall snazzy).
great, thanks for letting me know!
Sorry, I had to revert this change in standard v6.0.7 because it caused a much worse issue: feross/standard#429
We'll have to hold out for a proper fix from eslint: eslint/eslint#5175
I suggest just installing eslint-plugin-react at the top level of your project, or removing the dependency on eslint at the top-level to make things work for now.
Remove eslint dep
Was trying to use codeclimate eslint engine, so I might move away from snazzy and use https://github.com/jden/standard-codeclimate, but it's outdated.. was hoping to use latest eslint.
@knownasilya You should talk with @jden. He's probably fine with updating the standard version in standard-codeclimate.