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
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.