don't know why npm i -g still complains about _peer dependency_ in my env,
eslint -v which returns v2.2.0Strange. Do you have any other plugins installed? I just upgraded my eslint-plugin-mocha to 2.0, it was responsible for that same message for me.
@benmosher sure, currently installed plugins:
which eslint? I see that same message for npm list -g --depth=0 when in an nvm version that didn't have ESLint installed at all.
Which is to say: you could try npm i -g eslint or npm up -g eslint and see if it resolves?
or just npm list -g | grep eslint
(sorry for the timDiff) result of npm list -g | grep eslint is,
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
| `-- [email protected]
+-- [email protected]
and I did npm i -g eslint before running npm i -g eslint-plugin-import...
whereas the latter just responsed,
C:\Users\TimothyAppData\Roamingnpm
+-- UNMET PEER DEPENDENCY [email protected]
`-- [email protected]npm WARN [email protected] requires a peer of [email protected] but none was installed.
Anyway, it's just a WARN in npm 3, looks better than in npm 2 :)) Thanks'
Super weird. I'm not sure why that would happen. I didn't change the peerDependencies spec between 1.0.0 and 1.0.1, so I'm not sure why that would happen.
I am having same exact issue and I've been driving me mad when trying to deploy a vagrant box which installs eslint 2.x and eslint-plugin-import for a Meteor application.
I have run npm clean cache multiple times, sudo, as well as updating NPM to version 3.7.3, also reinstalling eslint and nuking /usr/local/lib
$ npm --version
3.7.3
$ eslint --version
2.10.2
$ npm install -g eslint-plugin-import
/usr/local/lib
โโโ UNMET PEER DEPENDENCY [email protected]
โโโฌ [email protected]
โโโ [email protected]
npm WARN [email protected] requires a peer of [email protected] but none was installed.
My best understanding is that npm 3.x no longer manages peerDependencies directly. However that does not explain the fact that I have eslint 2.10.2 installed in the same directory as eslint-plugin-import.
(source)
peerDependencies
peerDependencies no longer cause anything to be implicitly installed. Instead, npm will now warn if a packages peerDependencies are missing, but it's up to the consumer of the module (i.e. you) to ensure the peers get installed / are included in package.json as direct dependencies or devDependencies of your package.
3803 npm also no longer checks peerDependencies until after it has fully resolved the tree.
So is the solution just to ignore the error message? I'm getting something similar for [email protected]:
$ npm --version
3.9.5
eslint --version
v3.2.2
$ npm install
...
โโโ UNMET PEER DEPENDENCY [email protected]
...
While my package.json contains "eslint": "^3.0.1",
My suspicion was that this resulted from #437. What version of eslint-import-resolver-node is installed? (also what version of eslint-plugin-import?)
eslint-import-resolver-node is on 0.2.2 and eslint-plugin-import is on 1.12.0:
$ npm list | grep eslint
โโโฌ [email protected]
โโโฌ UNMET PEER DEPENDENCY [email protected]
โโโฌ [email protected]
โ โโโ UNMET PEER DEPENDENCY eslint@^2.9.0
โ โโโ [email protected]
โโโฌ [email protected]
โโโฌ [email protected]
โ โโโ [email protected]
โโโฌ [email protected]
โโโ [email protected]
npm ERR! peer dep missing: eslint@^2.9.0, required by [email protected]
npm ERR! peer dep missing: eslint@^2.9.0, required by [email protected]
ah, got it. yeah, your issue is airbnb's config, looks like the version you've got wants 2.9.0
Yeah, I was thinking this could be a separated issue because the error message is UNMET PEER DEPENDENCY [email protected], which suggest that some package is looking for 3.x that should be already be available.
Ah, yeah, IIRC that message actually means you've _got_ 3.2.2 and it's not meeting a peer's dependency requirements. I see similar things while using React v14 with component libraries looking for v13. (I could be wrong though, I had #437 wrong for a while)
Hum, I'm confused! The part
โโโฌ [email protected]
โ โโโ UNMET PEER DEPENDENCY eslint@^2.9.0
โ โโโ [email protected]
would then suggest that eslint-config-airbnb is using eslint 2.9.0 while it needs another version (from here is looks like it needs eslint 3.2.2)
(the wording of
npm ERR! peer dep missing: eslint@^2.9.0, required by [email protected]
is then a bit confusing :)
And then does the part
$ npm list | grep eslint
โโโฌ [email protected]
โโโฌ UNMET PEER DEPENDENCY [email protected]
means that some top packages level is using eslint 3.2.2 and would need some other version?
ah, right. that is bizarre.
I got the same problem
@wangzhen10 does npm ls exit zero?
npm install
npm info "eslint-config-airbnb-base@latest" peerDependencies
npm install -g install-peerdeps
install-peerdeps --dev eslint-config-airbnb-base
Add "extends": "airbnb-base" to .eslintrc file.
Finally, SUCCESS eslint-config-airbnb-base and its peerDeps were installed successfully.
Most helpful comment
Add "extends": "airbnb-base" to .eslintrc file.
Finally, SUCCESS eslint-config-airbnb-base and its peerDeps were installed successfully.