Ng build error with `Unknown argument: configuration`
See original GitHub issueπ Bug report
Command (mark with an x)
- new
- build
- serve
- test
- e2e
- generate
- add
- update
- lint
- extract-i18n
- run
- config
- help
- version
- doc
Is this a regression?
Yes, the previous version in which this bug was not present was: 13.xDescription
When i launch the command yarn ng run loyalty-v3:build --configuration=production on GitlabCI itβs not working with error
Error: Unknown argument: configuration. But on my localhost environment itβs working π
π¬ Minimal Reproduction
Launch command yarn ng run loyalty-v3:build --configuration=production on GitlabCI.
π₯ Exception or Error
$ yarn ng run loyalty-v3:build --configuration=production
Error: Unknown argument: configuration
π Your Environment
I launched yarn ng version on the CI and this is the output:
_ _ ____ _ ___
/ \ _ __ __ _ _ _| | __ _ _ __ / ___| | |_ _|
/ β³ \ | '_ \ / _` | | | | |/ _` | '__| | | | | | |
/ ___ \| | | | (_| | |_| | | (_| | | | |___| |___ | |
/_/ \_\_| |_|\__, |\__,_|_|\__,_|_| \____|_____|___|
|___/
Angular CLI: 14.0.2
Node: 14.18.3
Package Manager: yarn 3.2.1
OS: linux x64
Angular: 14.0.1
... animations, cdk, common, compiler, compiler-cli, core, forms
... localize, material, platform-browser
... platform-browser-dynamic, platform-server, router
Package Version
---------------------------------------------------------
@angular-devkit/architect 0.1400.2
@angular-devkit/build-angular 14.0.2
@angular-devkit/core 14.0.2
@angular-devkit/schematics 14.0.2
@angular/cli 14.0.2
@nguniversal/express-engine 14.0.1
@schematics/angular 14.0.2
rxjs 7.5.5
typescript 4.7.3
I launched yarn ng version on my localhost and this is the output:
_ _ ____ _ ___
/ \ _ __ __ _ _ _| | __ _ _ __ / ___| | |_ _|
/ β³ \ | '_ \ / _` | | | | |/ _` | '__| | | | | | |
/ ___ \| | | | (_| | |_| | | (_| | | | |___| |___ | |
/_/ \_\_| |_|\__, |\__,_|_|\__,_|_| \____|_____|___|
|___/
Angular CLI: 14.0.2
Node: 14.19.1
Package Manager: yarn 3.2.1
OS: darwin x64
Angular: 14.0.1
... animations, cdk, common, compiler, compiler-cli, core, forms
... localize, material, platform-browser
... platform-browser-dynamic, platform-server, router
Package Version
---------------------------------------------------------
@angular-devkit/architect 0.1400.2
@angular-devkit/build-angular 14.0.2
@angular-devkit/core 14.0.2
@angular-devkit/schematics 14.0.2
@angular/cli 14.0.2
@nguniversal/express-engine 14.0.1
@schematics/angular 14.0.2
rxjs 7.5.5
typescript 4.7.3
Anything else relevant?
Iβm using the builder custom webpack but I used the default buidler from angular and i have the same error. I submitted an Issue on the other repo too here.
Issue Analytics
- State:
- Created a year ago
- Comments:13
Top Results From Across the Web
ng build --prod => Error: Unknown argument: prod
The reason for this error is the command βprod is deprecated since Angular 12 and removed in Angular 14 based on this Angular-DeprecatedΒ ......
Read more >[Solved] Error: Unknown argument: prod While running ng build
To Solve Error: Unknown argument: prod While running ng build βprod Error As I mentioned in Solution 1 That βprod command is Deprecated...
Read more >6:36 PM Β· Sep 1, 2022
Error : unknown argument: prod in βng build βprod βaotβ β Code Example ... Use ng build --configuration production --aot or you'll get...
Read more >ng build
Option Description Value Type Default Value
ββaot Build using Ahead of Time compilation. boolean true
ββbaseβhref Base url for the application being built. string
ββdeleteβoutputβpath Delete...
Read more >How to manage different environments with Angular CLI ...
ng build --env=prod // For Angular 2 to 5 ... ng build --configuration=production ... For v6+, angular.json environments are now called configurations.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
We discussed this during yesterday triage meeting and we decided the we should include this as a breaking change in the release notes and also add a more actionable error message.
ng runis a generic command which can invoke any builders.ng buildis a dedicated command to invoke the configured build builder.These command have different syntaxes as described in the documentation:
More about these commands in the below links