0

I'm learning NPM and stuck at the first step. In my package.json, I added angular-material and expected it to download angular, aria and animate automatically. But it fails to do so. Checking some examples I see that everyone lists every dependency separately.

Isn't the whole point of using a package manager is to auto-download the dependencies?

  "dependencies": {
   "angular-material": "1.1.0"
  },


npm WARN angular-material@1.1.0 requires a peer of angular@>=1.3 <1.6 but none was installed.
npm WARN angular-material@1.1.0 requires a peer of angular-animate@>=1.3 <1.6 but none was installed.
npm WARN angular-material@1.1.0 requires a peer of angular-aria@>=1.3 <1.6 but none was installed.
Arthur
  • 1,478
  • 3
  • 22
  • 40
  • 1
    Also related http://stackoverflow.com/questions/18875674/whats-the-difference-between-dependencies-devdependencies-and-peerdependencies – str Apr 10 '17 at 07:14
  • So if I get to work on an existing project on a new computer that has 100 dependencies, I need to issue 100 `npm install` commands? – Arthur Apr 10 '17 at 09:26
  • 1
    No, but you need to understand the difference between `dependencies` and `peerDependencies`. – str Apr 10 '17 at 09:27
  • The answers linked are all seem to be for pre NPM 3.0. NPM is now at version 4.4.4. Is there a solution for newer versions or should I move back to 2.x? – Arthur Apr 10 '17 at 09:32
  • 1
    As I said, read about `peerDependencies`. Most packages at most have one `peerDependency`, many do not have one at all. Just add all your dependencies and `peerDependencies` of your dependencies to your packages.json and install all of them using `npm install`. – str Apr 10 '17 at 09:36

0 Answers0