Sergino
Sergino

Reputation: 10818

Angular2 beta 11 'npm install' warnings npm peerDependencies

Just installed Angular2 beta 11 npm install angular2 --save and got this warnings:

d:\Projects\sample>npm install angular2 --save
[email protected] d:\Projects\sample
+-- [email protected]
+-- UNMET PEER DEPENDENCY es6-promise@^3.0.2
+-- UNMET PEER DEPENDENCY es6-shim@^0.35.0
+-- UNMET PEER DEPENDENCY [email protected]
+-- UNMET PEER DEPENDENCY [email protected]
`-- UNMET PEER DEPENDENCY zone.js@^0.6.4

npm WARN [email protected] requires a peer of es6-promise@^3.0.2 but none was installed.
npm WARN [email protected] requires a peer of es6-shim@^0.35.0 but none was installed.
npm WARN [email protected] requires a peer of [email protected] but none was installed.
npm WARN [email protected] requires a peer of [email protected] but none was installed.
npm WARN [email protected] requires a peer of zone.js@^0.6.4 but none was installed.

Previous Angular2 versions installed dependencies es6-promise es6-shim rxjs zone.js in to main package.js but now it is not.

"dependencies": {
    "angular2": "^2.0.0-beta.11"
  } 

I checked the ..\node_modules\angular2\package.json and can see that it is relying on these packages:

    "peerDependencies": {
    "es6-promise": "^3.0.2",
    "es6-shim": "^0.35.0",
    "reflect-metadata": "0.1.2",
    "rxjs": "5.0.0-beta.2",
    "zone.js": "^0.6.4"
  }, 

Any thoughts?

Upvotes: 9

Views: 6183

Answers (3)

Donato Szilagyi
Donato Szilagyi

Reputation: 4369

After failing with npm install angular2 --save I just succeeded installing angular2 with this command:

npm install --save [email protected] [email protected] zone.js es6-shim [email protected]

If we get UNMET PEER DEPENDENCY then - after clearing the node_modules folder and removing the dependencies from package.json - we can do two things:

  • install a bit earlier version of angular2
  • install manually the missing dependencies

Upvotes: 5

Sergino
Sergino

Reputation: 10818

Looks like the answer is here https://github.com/npm/npm/issues/6565

NPM 3x:

  1. peerDependencies will no longer be implicitly installed if they're not already a dependency or devDependency. This is the biggest change, and is the piece most likely to require developer intervention.
  2. Invalid or missing peerDependencies will be a warning instead of an error. This will mean that irregularities with peerDependencies will be left to developers to sort out, but peerDependency incompatibilities should be less painful for consumers, because installs will bail out due to dependency problems significantly less frequently.

Upvotes: 0

Thierry Templier
Thierry Templier

Reputation: 202176

This means that Angular2 needs these dependencies (with correct versions) to work. You need to have them in your project dependencies.

See this link for more details:

Upvotes: 1

Related Questions