angular - ng build --prod 收到错误模块没有静态导出 true

标签 angular azure build angular-cli

仅当尝试在 Azure 中构建时,我才会收到错误。本地 ng 构建 - prod 工作正常。

Error: Module [path_to_file] has no static exports true

因为这是用于生产的,所以我不想 --aot=false 发现 here .

I did run it using --aot=false and am getting the same error.

我的构建定义是正确的,因为它上周已经运行并且尚未更新。

我假设构建中发生了某些更改,导致了此问题。

在我使用的 package.json 文件中 "@angular/cli": "^1.2.0"代表我的 devDependency

更新:

升级package.json 构建 cli devDependency 现在为“@angular/cli”:“^1.3.0”

同样的错误

最佳答案

终于建成了。

这就是我所做的

  1. upgraded the package using these instructions使用npm-check-updates npm package

    a. npm i -g npm-check-updates

    b. npm-check-updates -u

    c. npm 安装

  2. 安装了现在需要的所有额外依赖项

  3. 升级到最新的 Angular

  4. 运行 'ng build --prod' <-- 不带 --aot=false

关于angular - ng build --prod 收到错误模块没有静态导出 true,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45621859/

相关文章:

python - 错误 ModuleNotFoundError : No module named 'azure.keyvault.secrets' although I installed the package

php - CircleCI 2.0 : Build directory for scp/rsync deployment

asp.net - 当有人使用 AutoEventWireup ="true"时,如何让构建中断?

javascript - 如何将 highcharts-more.src.js 添加到 angular2 项目?

c# - Azure DocumentDB异步请求问题

azure - 适用于 Azure 的 FHIR 服务器部署

powershell - 如何显示 Visual Studio Online 构建任务 Write-Verbose 语句?

javascript - void 类型上不存在属性,尽管我正在返回一个 Promise

angular - Angular 应用程序中 Font Awesome 字体的 CORS 错误

Angular - 在路由到延迟加载模块时将数据传递给主机组件