首页 > 移动平台 > 详细

angular2 ng build --prod 报错:Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory'

时间:2017-08-08 14:57:47      阅读:7232      评论:0      收藏:0      [点我收藏+]

调试页面 ng serve 正常

ng build 也正常

ng build --prod 异常:Module not found: Error: Can‘t resolve ‘./$$_gendir/app/app.module.ngfactory‘

 

开始以为是以前那样,引用错了路径或少引用了东西。

搜了好多资料,发现是 angular-cli 的版本有点低了(因为用了最新的material)

找到原因了,问题就很容易解决了

第一步:

rm -rf node_modules/

第二部:

npm install --save-dev @angular/cli@latest

第三部:重新安装依赖

npm install

 

搞定!

angular2 ng build --prod 报错:Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory'

原文:http://www.cnblogs.com/Denny_Yang/p/7306600.html

(4)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!