【发布时间】:2017-12-18 06:03:52
【问题描述】:
我正在使用ng build --prod 命令,但它显示错误
ERROR in ./src/main.ts
Module not found: Error: Can't resolve './app/app.module.ngfactory' in 'C:\Users\allud\MyCafe\src'
resolve './app/app.module.ngfactory' in 'C:\Users\allud\MyCafe\src'
using description file: C:\Users\allud\MyCafe\package.json (relative path: ./src)
Field 'browser' doesn't contain a valid alias configuration
after using description file: C:\Users\allud\MyCafe\package.json (relative path: ./src)
using description file: C:\Users\allud\MyCafe\package.json (relative path: ./src/app/app.module.ngfactory)
no extension
Field 'browser' doesn't contain a valid alias configuration
C:\Users\allud\MyCafe\src\app\app.module.ngfactory doesn't exist
.ts
Field 'browser' doesn't contain a valid alias configuration
C:\Users\allud\MyCafe\src\app\app.module.ngfactory.ts doesn't exist
.js
Field 'browser' doesn't contain a valid alias configuration
C:\Users\allud\MyCafe\src\app\app.module.ngfactory.js doesn't exist
as directory
C:\Users\allud\MyCafe\src\app\app.module.ngfactory doesn't exist
[C:\Users\allud\MyCafe\src\app\app.module.ngfactory]
[C:\Users\allud\MyCafe\src\app\app.module.ngfactory.ts]
[C:\Users\allud\MyCafe\src\app\app.module.ngfactory.js]
[C:\Users\allud\MyCafe\src\app\app.module.ngfactory]
@ ./src/main.ts 3:0-66
@ multi ./src/main.ts
【问题讨论】:
-
你也可以发布你的代码吗??
-
我还没有编写任何代码。我刚刚开始使用 ng new myCafe、cd myCafe,然后是 ng build --prod。这是抛出错误。 ng serve 正常工作,所以代码还没有问题。
-
anglular和CLI的哪个版本? -
角 cli 版本 1.6.0
标签: angular build angular2-routing angular-cli