How do I fix the npm UNMET PEER DEPENDENCY warning?

249

I'm on Windows 10, with Node 5.6.0 and npm 3.6.0. I'm trying to install angular-material and mdi into my working folder. npm install angular-material mdi errors with:

+-- [email protected]

+-- UNMET PEER DEPENDENCY [email protected]^1.5.0

+-- UNMET PEER DEPENDENCY [email protected]^1.5.0

+-- [email protected]

+-- UNMET PEER DEPENDENCY [email protected]^1.5.0 `-- [email protected]

npm WARN enoent ENOENT: no such file or directory, open
'C:\Users\xxxxx\Desktop\ngClassifieds\package.json' 

npm WARN [email protected] requires a peer of
[email protected]^1.5.0 but none was installed. 

npm WARN [email protected] requires a peer of [email protected]^1.5.0
but none was installed. 

npm WARN [email protected] requires a peer of
[email protected]^1.5.0 but none was installed.

How do I resolve this to get AngularJS Material and MDI installed?

This question is tagged with angularjs node.js npm npm-install angularjs-material

~ Asked on 2016-03-02 04:09:42

The Best Answer is


224

npm no longer installs peer dependencies so you need to install them manually, just do an npm install on the needed deps, and then try to install the main one again.


Reply to comment:

it's right in that message, it says which deps you're missing

UNMET PEER DEPENDENCY [email protected]^1.5.0 +-- 
UNMET PEER DEPENDENCY [email protected]^1.5.0 +-- [email protected] +
UNMET PEER DEPENDENCY [email protected]^1.5.0 `-- [email protected]` 

So you need to npm install angular angular-animate angular-aria angular-material angular-messages mdi

~ Answered on 2016-03-02 04:11:42


75

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.

Then run

rm -rf node_modules/
npm cache clean
npm install

This will install all the required dependencies correctly.

~ Answered on 2016-10-04 12:45:28


Most Viewed Questions: