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.x

Description

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:closed
  • Created a year ago
  • Comments:13

github_iconTop GitHub Comments

3reactions
alan-agius4commented, Jun 17, 2022

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.

1reaction
alan-agius4commented, Jun 16, 2022

ng run is a generic command which can invoke any builders. ng build is a dedicated command to invoke the configured build builder.

These command have different syntaxes as described in the documentation:

ng run project:builder[:configuration]
ng build [project] --configuration=production

More about these commands in the below links

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found