Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NPM / Yarn suppress unmet dependencies warning if dependency is globally installed

Whilst installing packages with Yarn I get the following warning

warning Unmet peer dependency "webpack@1 || 2 || ^2.1.0-beta || ^2.2.0-rc"

Even though I have webpack installed globally.

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
/usr/local/lib
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
└── [email protected]

Thanks

like image 967
Daniel Granger Avatar asked Mar 01 '17 20:03

Daniel Granger


1 Answers

How do I suppress this warning

Right now there seems to be no way to mute this. There's an open issue on 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 (e.g. a bug fix) without worrying about webpack-dev-server breaking. 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. More info here

like image 72
Pieter Venter Avatar answered Oct 18 '22 01:10

Pieter Venter