Angular 字段';浏览器&x27;不';不包含有效的别名配置AOT编译错误

Angular 字段';浏览器&x27;不';不包含有效的别名配置AOT编译错误,angular,node-modules,angular2-aot,aot,Angular,Node Modules,Angular2 Aot,Aot,我正试图通过AOT构建我的Angular项目 正在运行ng build--prod,我收到一条错误消息 内部错误中的错误:未知标识符{“rethrowError”:false} 在./src/main.ts模块中找不到错误:错误:无法解决 “./$$\u gendir/app/app.module.ngfactory” 'C:\WorkingFolder\Development\admin client\src'解析 “./$$\u gendir/app/app.module.ngfactory

我正试图通过AOT构建我的Angular项目 正在运行ng build--prod,我收到一条错误消息

内部错误中的错误:未知标识符{“rethrowError”:false} 在./src/main.ts模块中找不到错误:错误:无法解决 “./$$\u gendir/app/app.module.ngfactory” 'C:\WorkingFolder\Development\admin client\src'解析 “./$$\u gendir/app/app.module.ngfactory” “C:\WorkingFolder\Development\admin client\src”使用 说明文件: C:\WorkingFolder\Development\admin client\package.json (相对路径:./src) 使用描述文件后,“浏览器”字段不包含有效的别名配置: C:\WorkingFolder\Development\admin client\package.json (相对路径:./src) 使用说明文件:C:\WorkingFolder\Development\admin client\package.json (相对路径:./src/$$\u gendir/app/app.module.ngfactory) 没有分机 字段“browser”不包含有效的别名配置 C:\WorkingFolder\Development\admin client angular\src\$$\u gendir\app\app.module.ngfactory 不存在 .ts 字段“browser”不包含有效的别名配置 C:\WorkingFolder\Development\admin client angular\src\$$\u gendir\app\app.module.ngfactory.ts 不存在 .js 字段“browser”不包含有效的别名配置 C:\WorkingFolder\Development\admin client angular\src\$$\u gendir\app\app.module.ngfactory.js 不存在 作为目录 C:\WorkingFolder\Development\admin client angular\src\$$\u gendir\app\app.module.ngfactory 不存在 [C:\WorkingFolder\Development\admin client angular\src\$$\u gendir\app\app.module.ngfactory] [C:\WorkingFolder\Development\admin client angular\src\$$\u gendir\app\app.module.ngfactory.ts] [C:\WorkingFolder\Development\admin client\src\$$\u gendir\app\app.module.ngfactory.js] [C:\WorkingFolder\Development\admin client angular\src\$$\u gendir\app\app.module.ngfactory] @./src/main.ts 3:0-74@multi./src/main.ts


在我的例子中,我在单元测试中遇到了类似的错误。结果发现我之前从错误的地方导入了:

import {beforeEach} from "selenium-webdriver/testing";

我一消除这个错误就消失了

请提供副本,也许你会发现这篇文章很有用: