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
└── zone.js@0.6.25
node $ sudo npm -g --save install rxjs@5.0.0-beta.12
/usr/lib
└── rxjs@5.0.0-beta.12
... And, yet; angular@core
reports:
node $ sudo npm -g --save install @angular/core
/usr/lib
├── @angular/core@2.0.1
├── UNMET PEER DEPENDENCY rxjs@5.0.0-beta.12
└── UNMET PEER DEPENDENCY zone.js@^0.6.21
npm WARN @angular/core@2.0.1 requires a peer of rxjs@5.0.0-beta.12 but none was installed.
npm WARN @angular/core@2.0.1 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 rxjs@5.0.0-beta.12 zone.js@^0.6.21 @angular/core -registry http://registry.npmjs.org/
/usr/lib
├── @angular/core@2.0.1
├── rxjs@5.0.0-beta.12
└── zone.js@0.6.25
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.
- Clean-up / reset
- Work from the independent to
- 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/common@2.0.1
├── @angular/compiler@2.0.1
├─┬ @angular/compiler-cli@0.6.3
│ └─┬ @angular/tsc-wrapped@0.3.0
│ └── tsickle@0.1.7
├── @angular/core@2.0.1
├── @angular/forms@2.0.1
├── @angular/http@2.0.1
├── @angular/platform-browser@2.0.1
├─┬ @angular/platform-server@2.0.1
│ └── parse5@1.3.2
├── rxjs@5.0.0-beta.12
├── typescript@2.0.3
└── zone.js@0.6.25
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 :-)