未找到模块:' ./ app.module.ngfactory'我在构建iOS应用程序时--prod --release

时间:2018-04-11 06:21:03

标签: ios angular cordova ionic-framework

我已经在Ionic中开发了一个应用程序,当我尝试使用--prod部署我的应用程序时,它抛出以下错误并且没有--prod工作正常。

命令:val activity = itemView.context as? MainActivity // then you can show your dialog with activity?.supportFragmentManager

错误:

  

错误:./ src / app / main.ts

     

找不到模块:错误:无法解析' ./ app.module.ngfactory'在   ' /卷/ DATA / Dhanesh /项目/ FA   应用程序/ TestNewCordova / failure_analysis_app /离子/ SRC /应用'解决   ' ./ app.module.ngfactory' in' / Volumes / DATA / Dhanesh / Projects / FA   应用程序/ TestNewCordova / failure_analysis_app /离子/ SRC /应用'运用   description file:/ Volumes / DATA / Dhanesh / Projects / FA   app / TestNewCordova / failure_analysis_app / Ionic / package.json(亲戚   路径:./ src / app)       Field'浏览器'使用描述文件后,不包含有效的别名配置:/ Volumes / DATA / Dhanesh / Projects / FA   app / TestNewCordova / failure_analysis_app / Ionic / package.json(亲戚   路径:./ src / app)       使用描述文件:/ Volumes / DATA / Dhanesh / Projects / FA app / TestNewCordova / failure_analysis_app / Ionic / package.json(亲戚)   路径:./ src / app / app.module.ngfactory)         没有扩展名

如果我删除--prod并运行sudo ionic cordova build ios --release --prod

并且没有成功构建。

我找到了很多针对上述错误的解决方案,但仍然没有从这个错误中解脱出来。

参考我到目前为止尝试过:

  1. 尝试在sudo ionic cordova build ios --release中找到错误,但那里没有错误日志。

  2. github上的一些帖子也无效https://github.com/angular/angular-cli/issues/8858

  3. 如果有人用离子生成ios解决了同样的问题,请帮助我。

    提前致谢!

    编辑:

    $ ./node_modules/.bin/ngc

1 个答案:

答案 0 :(得分:1)

只需使用npm install @ ionic / app-scripts @ latest --save-dev 升级离子应用脚本,然后使用--prod flag再次检查运行构建