The build command requires to be run in an Angular project, but a project definition could not be fo

报错:The build command requires to be run in an Angular project, but a project definition could not be found

本来是为了解决cli版本过低的问题,一下子从1.2.7升级到7.3.6,运行node --max-old-space-size=3000 \"node_modules/@angular/cli/bin/ng\" build --prod --aot,直接报错,原因是在新版本的@angular/cli,angular.json替代了angular-cli.json,所以它认为这不是一个angular项目!

解决方式:

ng update @angular/cli --migrate-only --from=1.7.3

https://stackoverflow.com/questions/53096996/angular-cli-error-the-serve-command-requires-to-be-run-in-an-angular-project-b

报错:FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory

ng build 编译没有问题,ng build --pord --aot 编译就报这个错

解决:node --max-old-space-size=3000 \"node_modules/@angular/cli/bin/ng\" build --pord --aot

主要是增加参数--max-old-space-size=3000,这个内存配置多大,试着看咯,单位是M

 

 

报错:

ERROR in ./src/main.ts

Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory' in

解决:据说是angular/cli的版本过低,还没验证!

 

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值