Error after installing eslint-plugin-react, there's an unmet peer dependency for eslint, which I have installed and is the latest. Here's the command line:
`helder@Helders-MBP:~$ npm install -g eslint
/Users/helder/.nvm/versions/node/v6.6.0/bin/eslint -> /Users/helder/.nvm/versions/node/v6.6.0/lib/node_modules/eslint/bin/eslint.js
/Users/helder/.nvm/versions/node/v6.6.0/lib
└── [email protected]
helder@Helders-MBP:~$ npm install -g eslint-plugin-react
/Users/helder/.nvm/versions/node/v6.6.0/lib
├── UNMET PEER DEPENDENCY eslint@^2.0.0 || ^3.0.0
└── [email protected]
npm WARN [email protected] requires a peer of eslint@^2.0.0 || ^3.0.0 but none was installed.`
I wouldn't recommend installing eslint globally.
It's a false warning by npm, everything should be working as expected after the installation.
Atom Linter member (AtomLinter/linter-eslint#514) say
If you are using a global eslint, you will need to install eslint configs and plugins globally as well.
However, it's not critical problem. I still use it with Atom Linter. 🤷
Seeing this when trying to npm install eslint -g and then npm install eslint-plugin-react -g
I suppose I can just install the project to avoid Atom's errors, but often times I am pulling a project not to run it, but to browse the source. It'd be nice if this didn't fail so Atom wouldn't yell at me for not running npm install on every project I clone.
That seems like something worth filing on Atom itself - ideally you should have only locally installed eslints, and Atom should be able to silently ignore repos without an eslint config.
The issue is that almost every repo these days that I'm pulling has an eslintrc file, so Atom tries to use it and fails. I suppose alternatively I could delete these configs when I'm browsing source but not feeling like installing.
Are you not running npm install in these repos prior to interacting with the source? If you are, why would Atom be failing?
Sorry, that's what I referenced above:
I suppose I can just install the project to avoid Atom's errors, but often times I am pulling a project not to run it, but to browse the source. It'd be nice if this didn't fail so Atom wouldn't yell at me for not running
npm installon every project I clone.
Ah, gotcha.
In that case I'd submit a bug to Atom to be silent when eslint isn't found :-)
Most helpful comment
It's a false warning by
npm, everything should be working as expected after the installation.