Issue
When I try to build my angular project in production environment:
ng build --prod --aot
the console returns this error:
Error: Unknown argument: prod
ng serve
is working fine and ng build
without parameters seems to work too. Why does angular return such an error?
Solution
The reason for this error is
the command --prod
is deprecated since Angular 12 and removed in Angular 14
based on this Angular-Deprecated APIs and features.
Use --configuration production
instead.
So the command will be:
ng build --configuration production
Answered By - Nabeeh_Sawaf
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.