简体   繁体   English

解决NPM中的对等依赖性问题

[英]Solving peer dependency issue in NPM

I'm having trouble figuring out how exactly to satisfy the peer dependencies for different npm packages at the minute when I run npm install . 我在运行npm install那一刻很难弄清楚如何完全满足不同npm软件包的对等依赖性。 This is the error message I appear to getting. 这是我似乎收到的错误消息。

npm ERR! peerinvalid The package eslint@2.11.1 does not satisfy 
its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer eslint-config-airbnb@6.2.0 wants eslint@^2.4.0
npm ERR! peerinvalid Peer eslint-plugin-mocha@2.2.0 wants eslint@^2.0.0
npm ERR! peerinvalid Peer eslint-plugin-import@1.8.1 wants eslint@2.x
npm ERR! peerinvalid Peer babel-eslint@5.0.4 wants eslint@<2.3.0

I have failed in a few attempts and cannot understand how to get to the solution here. 我几次尝试都失败了,无法理解如何在这里找到解决方案。

You probably have eslint@2.11.1 installed globally ? 您可能在全局安装了eslint@2.11.1?

Try uninstall -g it, and run npm install again 尝试卸载-g它,然后再次运行npm install

Also look here 也看这里

Looks like some versions had their wires crossed somehow. 看起来有些版本的导线以某种方式交叉了。 Ended up removing my node_modules directory rm -r node_modules and reinstalling npm install and that fixed it. 最终删除了我的node_modules目录rm -r node_modules并重新安装了npm install并对其进行了修复。

npm dependency issue when installing... well, pretty much anything 安装时的npm依赖问题...很好,几乎所有东西


The error messages don't have to be related to the package you're trying to install. 错误消息不必与您要安装的软件包有关。 That means, if you want to install eg kss the error doesn't mean there is a problem with kss. 这意味着,如果您要安装例如kss,则该错误并不表示kss存在问题。

Ok, so what? 好吧,那又如何呢? Check the additional messages prompted during the installation attempt and find the packages that cause the problem. 检查安装尝试过程中提示的其他消息,并找到引起问题的软件包。 The sections look like 这些部分看起来像

npm ERR! peerinvalid The package grunt does not satisfy its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer grunt-contrib-copy@0.5.0 wants grunt@~0.4.0
npm ERR! peerinvalid Peer grunt-contrib-clean@0.5.0 wants grunt@~0.4.0
npm ERR! peerinvalid Peer grunt-contrib-concat@0.3.0 wants grunt@~0.4.0

https://futurestud.io/blog/how-to-fix-npm-package-does-not-satisfy-its-siblings-peerdependencies-requirements https://futurestud.io/blog/how-to-fix-npm-package-does-not-satisfy-its-siblings-peerdependencies-requirements

Their solution is to either update or uninstall the modules. 他们的解决方案是更新或卸载模块。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM