Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unmet peer dependency [email protected]

I am trying to run npm install on a project and it is unable to resolve webpack package. I have followed most of the other questions answers found in google and on here.

I have completely cleaned computer of nodejs + npm files, again by following answers on here : How to completely remove node.js from Windows Unmet Peer Dependency angular 2.3.0 rxjs zone.js

I have tried to install the unmet dependencies manually, globally, persisting it to the package.json with npm install --save. Installing the specific versions it asks for and then also the latest versions.

The error that I have is: UNMET PEER DEPENDENCY [email protected]

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 
(node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for 
[email protected]: wanted {"os":"darwin","arch":"a
ny"} (current: {"os":"win32","arch":"x64"})
npm WARN [email protected] requires a peer of webpack@^2 || ^2.2.0-rc.0 || 
^2.1.0-beta || ^1.12.6 but none was install
ed.
PS C:\Users\david.maceachern\Projects\ia_beta\impacttool\src\ui> npm install 
--save webpack
[email protected] 
C:\Users\david.maceachern\Projects\ia_beta\impacttool\src\ui
`-- UNMET PEER DEPENDENCY [email protected]

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 
(node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for 
[email protected]: wanted {"os":"darwin","arch":"a
ny"} (current: {"os":"win32","arch":"x64"})
npm WARN [email protected] requires a peer of webpack@^2 || ^2.2.0-rc.0 || 
^2.1.0-beta || ^1.12.6 but none was install
ed.
npm ERR! code 1
like image 390
davidmaceachern Avatar asked Sep 19 '17 19:09

davidmaceachern


People also ask

Has unmet Peer dependency meaning?

UNMET PEER DEPENDENCY error is thrown when the dependencies of one or more modules specified in the package. json file is not met. Check the warnings carefully and update the package. json file with correct versions of dependencies.

How do you ignore peer dependencies?

Using --legacy-peer-deps will usually allow you to install the package without meeting the peer dependency requirements. (This was the default using npm@6 so I assume you are using npm@7 if you are seeing a problem.) If that doesn't work, --force will install without regard to peer dependencies. Save this answer.

What is peer dependency?

A peer dependency specifies that our package is compatible with a particular version of an npm package. If a package doesn't already exist in the node_modules directory, then it is automatically added. As you install a package, npm will automatically install the dev dependencies.


1 Answers

I solved this issue by reading about peer dependencies https://nodejs.org/en/blog/npm/peer-dependencies/, and proceeding to clean up my package.json fixing the versions so that npm install would not install a version with major breaking changes.

I identified the correct versions by checking the release notes on github of packages that appeared in the npm error.

like image 158
davidmaceachern Avatar answered Sep 23 '22 10:09

davidmaceachern