我相信我已经事先成功解决了此类问题,或多或少遵循了这个流行问题中概述的方法:
- https://stackoverflow.com/a/35738361/108350 https://stackoverflow.com/a/35738361/108350
如果跳到底部,报告的错误表明
- rxjs@5.0.0-beta.12
- zone.js@^0.6.21
到了这个阶段(如下图所示,来自我的bash
session)这两个模块都已安装first.
node $ sudo npm -g --save install zone.js@^0.6.21
/usr/lib
└── [email protected] /cdn-cgi/l/email-protection
node $ sudo npm -g --save install [email protected] /cdn-cgi/l/email-protection
/usr/lib
└── [email protected] /cdn-cgi/l/email-protection
... 但是;angular@core
报告:
node $ sudo npm -g --save install @angular/core
/usr/lib
├── @angular/[email protected] /cdn-cgi/l/email-protection
├── UNMET PEER DEPENDENCY [email protected] /cdn-cgi/l/email-protection
└── UNMET PEER DEPENDENCY zone.js@^0.6.21
npm WARN @angular/[email protected] /cdn-cgi/l/email-protection requires a peer of [email protected] /cdn-cgi/l/email-protection but none was installed.
npm WARN @angular/[email protected] /cdn-cgi/l/email-protection requires a peer of zone.js@^0.6.21 but none was installed.
安装报告:unmet peer dependency
,在两个模块上。即使在我有了之后
这对我来说似乎是循环的。我相当确定已安装软件包的版本编号和未满足错误是相同的版本。
这种同义反复的依赖地狱似乎很常见,我的搜索是:
[angular2] unmet peer dependency
快速产生 23 个结果,主要针对 beta-s 或不同的软件包组合。我不得不为过去对 Maven JAR-hell 的严厉言论表示歉意。
有解决办法吗?我(也许?)误解了消息的含义吗?
作为后续查询,是否有一个工具或网页可以执行“dry run“验证此类安装问题?
...提前致谢.
codicil(第二次更新,2016-09-28)...
我运行了以下命令npm
刚才的指令,与surprise结果(如图所示):
node $ sudo npm -g --save install [email protected] /cdn-cgi/l/email-protection zone.js@^0.6.21 @angular/core -registry http://registry.npmjs.org/
/usr/lib
├── @angular/[email protected] /cdn-cgi/l/email-protection
├── [email protected] /cdn-cgi/l/email-protection
└── [email protected] /cdn-cgi/l/email-protection
因此,一体化npm install
似乎是对我(现在)认为是错误的有效解决方法。
鉴于这个结果我猜人们的package.json
文件是safe。显然,在同一事务/操作中处理是重要的(尽管没有记录;基于我在尝试时看到的 NOENT 和 UNMET 问题的数量)eek这个)。
我现在正在考虑如何外包这部分等式......
说够了;这个食谱在这种情况下有效。我第一次应用的步骤在过去已经多次发挥作用。
- 清理/重置
- 从独立工作到
- 最依赖的人
给出这个结果,这就是我们以前所说的相互依赖在 80 年代,还是纠缠。
继续我最初所做的事情,我发现所有这些模块必须位于同一个中npm install
使其正常工作而不会出现错误或警告。
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] /cdn-cgi/l/email-protection
├── @angular/[email protected] /cdn-cgi/l/email-protection
├─┬ @angular/[email protected] /cdn-cgi/l/email-protection
│ └─┬ @angular/[email protected] /cdn-cgi/l/email-protection
│ └── [email protected] /cdn-cgi/l/email-protection
├── @angular/[email protected] /cdn-cgi/l/email-protection
├── @angular/[email protected] /cdn-cgi/l/email-protection
├── @angular/[email protected] /cdn-cgi/l/email-protection
├── @angular/[email protected] /cdn-cgi/l/email-protection
├─┬ @angular/[email protected] /cdn-cgi/l/email-protection
│ └── [email protected] /cdn-cgi/l/email-protection
├── rx[email protected] /cdn-cgi/l/email-protection
├── [email protected] /cdn-cgi/l/email-protection
└── [email protected] /cdn-cgi/l/email-protection
我最大的惊喜是(now) 打字稿是必需的依赖项@angular/compiler-cli
。以前我很高兴使用 Javascript,没有使用 typescript。希望这是一个glitch当理智恢复时修复。
也许这个额外的更新没有增加任何内容codicil因为看起来好像npm install
问题是懒惰:
据我所知,根据本周的结果。不过现在才星期三:-)