[英]NPM / Yarn suppress unmet dependencies warning if dependency is globally installed
Whilst installing packages with Yarn I get the following warning 使用Yarn安装软件包时,出现以下警告
warning Unmet peer dependency "webpack@1 || 2 || ^2.1.0-beta || ^2.2.0-rc"
Even though I have webpack installed globally. 即使我在全球范围内安装了webpack。
How do I suppress this warning or do I just have to installed it within the project? 如何取消显示此警告,或者仅将其安装在项目中?
Here is my npm list -g --depth=0
output 这是我的
npm list -g --depth=0
输出
npm list -g --depth=0
/usr/local/lib
├── bower@1.8.0
├── browser-sync@2.17.5
├── bufferutil@1.3.0
├── chai@3.5.0
├── create-react-app@1.1.0
├── emoj@0.4.0
├── handlebars@4.0.6
├── hpm-cli@2.0.0
├── http-server@0.9.0
├── jsdoc@3.4.2
├── jshint@2.9.4
├── mocha@3.2.0
├── node-gyp@3.5.0
├── node-inspector@0.12.8
├── nodemon@1.11.0
├── npm@4.4.0
├── snazzy@6.0.0
├── standard@8.6.0
├── webpack@2.2.1
├── webpack-dev-server@2.4.1
└── yarn@0.18.2
Thanks 谢谢
How do I suppress this warning
我如何抑制此警告
Right now there seems to be no way to mute this. 现在看来,似乎没有办法使它静音。 There's an open issue on github
github上有一个开放的问题
or do I just have to install it within the project?
还是只需要在项目中安装它?
Peer dependencies mean that you need to install it yourself. 对等依赖项意味着您需要自己安装它。 This is so that the package that you can update your dependency without waiting for the package that uses it to be updated.
这样一来,您就可以更新依赖包,而不必等待使用它的包被更新。 As an example,
webpack-dev-server
would depend on a certain version range of webpack
, but you can update to a new minor version of webpack (eg a bug fix) without worrying about webpack-dev-server
breaking. 例如,
webpack-dev-server
将取决于webpack
的特定版本范围,但是您可以更新到webpack的新次要版本(例如,错误修复),而不必担心webpack-dev-server
损坏。 This way you if some other package depends on a later version of webpack
than webpack-dev-server
does, you do not end up with 2 conflicting versions of webpack
. 这样,如果其他软件包依赖于
webpack
版本高于webpack-dev-server
版本,则不会导致两个相互冲突的webpack
版本。 More info here 更多信息在这里
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.