How to solve npm UNMET PEER DEPENDENCY

I am on Windows 10, Node version 5.6.0 and Npm version 3.6.0. Trying to install angular-material and mdi onto my working folder. npm install angular-material mdi gives me the following error messages:

+-- angular@1.5.0

+-- UNMET PEER DEPENDENCY angular-animate@^1.5.0

+-- UNMET PEER DEPENDENCY angular-aria@^1.5.0

+-- angular-material@1.0.6

+-- UNMET PEER DEPENDENCY angular-messages@^1.5.0 `-- mdi@1.4.57

npm WARN enoent ENOENT: no such file or directory, open 'C:UsersxxxxxDesktopngClassifiedspackage.json'

npm WARN angular-material@1.0.6 requires a peer of angular-animate@^1.5.0 but none was installed.

npm WARN angular-material@1.0.6 requires a peer of angular-aria@^1.5.0 but none was installed.

npm WARN angular-material@1.0.6 requires a peer of angular-messages@^1.5.0 but none was installed.

How do I resolve this to get angular material and mdi installed?


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 angular-animate@^1.5.0 +-- 
UNMET PEER DEPENDENCY angular-aria@^1.5.0 +-- angular-material@1.0.6 +
UNMET PEER DEPENDENCY angular-messages@^1.5.0 `-- mdi@1.4.57` 

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


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.


In my case all the dependencies were already there. Please update NPM in that case as it might have been crashed. It solved my problem. npm install -g npm

链接地址: http://www.djcxy.com/p/27644.html

上一篇: 使用Composer安装特定版本的软件包

下一篇: 如何解决npm UNMET PEER DEPENDENCY