【问题标题】:updated from angular 5 to angular 6 and can't build a dist folder anymore从 angular 5 更新到 angular 6 并且不能再构建 dist 文件夹
【发布时间】:2018-06-11 21:59:08
【问题描述】:

这是我的设置:

Angular CLI: 6.0.8
Node: 8.10.0
OS: win32 x64
Angular: 5.2.11
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, platform-server, router

Package                      Version
------------------------------------------------------
@angular-devkit/architect    0.6.8
@angular-devkit/core         0.6.8
@angular-devkit/schematics   0.6.8
@angular/cli                 6.0.8
@schematics/angular          0.6.8
@schematics/update           0.6.8
rxjs                         5.5.11
typescript                   2.4.2

我已经试过了:

  • ng 构建
  • ng build --prod
  • ng build --environment=prod
  • ng build --target=production --environment=prod
  • ng build --prod --env=prod
  • npm run build 等。

我现在完全不知道为什么没有建立 dist,如果有人可以提供帮助,我将不胜感激

【问题讨论】:

  • 如果使用 angular cli 6,您可能还需要 angular 6。按照此处的步骤update.angular.io 迁移您的 Angular 5 项目。如果您包含从控制台收到的任何错误,那就太好了..

标签: angular build production-environment angular6 rxjs6


【解决方案1】:

使用 Angular 6,您需要 RxJS 6。

来自文档:

6.0.0 (2018-05-03)

依赖更新

@angular/core 现在依赖于

  • TypeScript 2.7
  • RxJS 6.0.0
  • tslib 1.9.0

@angular/platform-server 现在依赖于

  • 多米诺骨牌 2.0

——https://github.com/angular/angular/blob/master/CHANGELOG.md#dependency-updates

【讨论】:

    【解决方案2】:

    感谢您的回答,但我的问题的解决方案有点令人尴尬...我正在通过 jenkins 构建 dist 文件夹,并在我的脚本中复制了一个 package.json 文件,因为我复制的每个 package.json 文件, 在 dist 构建之前指向不同的服务器 - 因此所有更新都被旧的 package.json 文件覆盖(我忘了更新这个!!)...我告诉过你这有点尴尬 - 但谢谢不过,感谢您的宝贵时间

    【讨论】:

      猜你喜欢
      • 2019-04-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-12-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多