I seem to have gone down a rabbit hole with this. While I'm using webpack as an example, I'm looking for an answer that isn't specific to webpack. Ideally, I'd like to resolve these, but should I even bother?
I have an application whose dependencies have peer dependencies of various versions of webpack. When I run npm install
, this is what I see (new lines added for clarity):
npm WARN babel-loader@7.1.2 requires a peer of webpack@2 || 3 but none is installed. You must install peer dependencies yourself.
npm WARN extract-text-webpack-plugin@3.0.2 requires a peer of webpack@^3.1.0 but none is installed. You must install peer dependencies yourself.
npm WARN file-loader@1.1.5 requires a peer of webpack@^2.0.0 || ^3.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN html-webpack-plugin@2.29.0 requires a peer of webpack@1 || ^2 || ^2.1.0-beta || ^2.2.0-rc || ^3 but none is installed. You must install peer dependencies yourself.
npm WARN css-loader@1.0.0 requires a peer of webpack@^4.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN schema-utils@0.4.5 requires a peer of webpack@^2.0.0 || ^3.0.0 || ^4.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN sw-precache-webpack-plugin@0.11.4 requires a peer of webpack@^1 ||^2 || ^2.1.0-beta || ^2.2.0-beta || ^3 but none is installed. You must install peer dependencies yourself.
npm WARN uglifyjs-webpack-plugin@0.4.6 requires a peer of webpack@^1.9 || ^2 || ^2.1.0-beta || ^2.2.0-rc || ^3.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN webpack-dev-middleware@1.12.2 requires a peer of webpack@^1.0.0 ||^2.0.0 || ^3.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN webpack-dev-server@2.9.4 requires a peer of webpack@^2.2.0 || ^3.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN webpack-manifest-plugin@1.3.2 requires a peer of webpack@1 || 2 ||3 but none is installed. You must install peer dependencies yourself.
I tried to install all the various versions, but wasn't sure how. In my package.json, the entry for webpack just kept updating to the last installed. When I hit webpack@3.12.0
, the number of dependencies went down to:
npm WARN react-google-maps@9.4.5 requires a peer of @types/googlemaps@^3.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN react-google-maps@9.4.5 requires a peer of @types/markerclustererplus@^2.1.29 but none is installed. You must install peer dependencies yourself.
npm WARN react-google-maps@9.4.5 requires a peer of @types/react@^15.0.0 ||^16.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN css-loader@1.0.0 requires a peer of webpack@^4.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN schema-utils@0.4.5 requires a peer of webpack@^2.0.0 || ^3.0.0 || ^4.0.0 but none is installed. You must install peer dependencies yourself.
So, it seems that 3.12.0 meets the needs of most of my dependencies, but there are still some that are fussing. Ugh.
I tried putting things like "webpack": "^3.0.0 || ^3.0.0 || ^4.0.0"
into my package.json but that didn't really do anything. Maybe I need to add them all?
I've looked at many of the answers here, but a lot of them are Angular specific or just say "upgrade to npm >= 3". Ideally, I'm looking for a way to get these warnings to go away in any situation where many dependencies require different versions of another dependency.
This answer seems to get really close: https://stackoverflow.com/a/22004559/2800116
I tried npm install --production
, to no avail.
Many answers here ask how to fix this hell but are not yet answered: npm started requestion manual install of peer dependencies
My question is, should I even bother with getting these to resolve? It doesn't make the application break or anything, but it's just really annoying seeing these. I'm worried it'll create a "boy who cried wolf" situation where I'll just treat them as noise and miss things that could be important. Sometimes even adding one of these peers adds MORE unmet peer dependencies. Good grief!