Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 439
sreginogemoh Avatar asked Mar 18 '16 22:03

sreginogemoh


2 Answers

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
like image 72
Donato Szilagyi Avatar answered Oct 31 '22 21:10

Donato Szilagyi


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:

  • https://nodejs.org/en/blog/npm/peer-dependencies/
like image 31
Thierry Templier Avatar answered Oct 31 '22 21:10

Thierry Templier