3

I believe I have successfully resolved this kind of issue beforehand, more or less following the approach outlined in this popular question:

If you skip to the bottom the reported errors indicate the

  • rxjs@5.0.0-beta.12
  • zone.js@^0.6.21

By this stage (as shown below from my bash session) both of these modules are installed first.

 node $ sudo npm -g --save install zone.js@^0.6.21
/usr/lib
└── [email protected] 

node $ sudo npm -g --save install  [email protected]
/usr/lib
└── [email protected] 

... And, yet; angular@core reports:

  node $ sudo npm -g --save install  @angular/core
  /usr/lib
  ├── @angular/[email protected] 
  ├── UNMET PEER DEPENDENCY [email protected]
  └── UNMET PEER DEPENDENCY zone.js@^0.6.21

  npm WARN @angular/[email protected] requires a peer of [email protected] but none was installed.
  npm WARN @angular/[email protected] requires a peer of zone.js@^0.6.21 but none was installed.

Install reports an: unmet peer dependency, on both modules. Even after I have

  • npm remove -g each of these three packages

This appears to be circular to me. I am fairly sure the version numberings on the installed packages and the Unmet error are the same versions.

This kind of tautological dependency hell seems common place my search on:

  • [angular2] unmet peer dependency

Rapidly yielded 23 results mostly on beta-s or different package combinations. I am forced to apologies for harsh words about Maven JAR-hell in the past.

Is there a solution? Am I (perhaps?) misreading the meaning of the messages?

As a follow-up query, is there a tool or web page that can do a "dry run" to validate these kind of install issues??

... my thanks in advance.


codicil (2nd update, 2016-09-28) ...

  • thanks due to @David L for giving me the idea

I ran the following npm instruction just now, with the surprise result (as shown):

node $ sudo npm -g --save install   [email protected]  zone.js@^0.6.21  @angular/core  -registry http://registry.npmjs.org/
/usr/lib
├── @angular/[email protected] 
├── [email protected] 
└── [email protected] 

Thus and all-in-one npm install appears to be a valid work-around to what I (now) consider a bug.

Given this result I guess people's package.json files are safe. Apparently being handled in the same transaction/operation is Significant (albeit undocumented; based on the number of NOENT and UNMET questions I saw while trying to eek this one).

I'm now considering how to out-source this part of the equation ...

Enough said; this recipe worked in this case. The steps I applied in the first instance have worked many, many times in the past.

  1. Clean-up / reset
  2. Work from the independent to
  3. The most dependent

Given this result, that's what we used to call co-dependent in the '80-s, or entanglement.

Progressing what I was originally doing, I've discovered that ALL these modules MUST be in the same npm install for it to work without errors or warnings.

  node $ sudo npm -g --save install tsickle rxjs \ 
  @angular/core @angular/platform-browser zone.js  \
  @angular/compiler   @angular/common   \
  @angular/compiler-cli \
  @angular/http   @angular/forms  typescript \
  @angular/platform-server   -registry http://registry.npmjs.org/

  /usr/bin/tsickle -> /usr/lib/node_modules/tsickle/build/src/main.js
  /usr/bin/ngc -> /usr/lib/node_modules/@angular/compiler-cli/src/main.js
  /usr/bin/ng-xi18n -> /usr/lib/node_modules/@angular/compiler-cli/src/extract_i18n.js
  /usr/bin/tsc -> /usr/lib/node_modules/typescript/bin/tsc
  /usr/bin/tsserver -> /usr/lib/node_modules/typescript/bin/tsserver
  /usr/lib

  ├── @angular/[email protected] 
  ├── @angular/[email protected] 
  ├─┬ @angular/[email protected] 
  │ └─┬ @angular/[email protected]
  │   └── [email protected] 
  ├── @angular/[email protected] 
  ├── @angular/[email protected] 
  ├── @angular/[email protected] 
  ├── @angular/[email protected] 
  ├─┬ @angular/[email protected] 
  │ └── [email protected] 
  ├── [email protected] 
  ├── [email protected] 
  └── [email protected] 

My BIG surprise here is that (now) typescript is a required dependency for @angular/compiler-cli. I was happily using Javascript before with no typescript. Hopefully this is a glitch fixed when sanity returns.

Perhaps this extra update adds nothing to the codicil because it seems as if the npm install problem is laziness:

  • npm is Not looking very well at the resident bits already installed

As far as I can see based on the results this week. Still it is only Wednesday :-)

2
  • If you install all three packages locally instead of globally, does anything change? Commented Sep 27, 2016 at 13:11
  • @DavidL ... thanks for your suggesting. As you see there is fruit. Although I didn't need to use plain non-global. However that's kind of behaviour usually represents an some kind of entanglement imho. Things probably need to be factored out to more-basic sub-bits. Commented Sep 28, 2016 at 12:53

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.