2
votes

I'm trying to run the following command: ng build --target=production --base-href / but it gives me the following error:

Error: Cannot determine project or target for Architect command. at MergeMapSubscriber._loadWorkspaceAndArchitect.pipe.operators_1.concatMap [as project] (C:\training\angular4\angular-reddit\node_modules\@angular\cli\models\architect-command.js:70:27) at MergeMapSubscriber._tryNext (C:\training\angular4\angular-reddit\node_modules\rxjs\internal\operators\mergeMap.js:65:27) at MergeMapSubscriber._next (C:\training\angular4\angular-reddit\node_modules\rxjs\internal\operators\mergeMap.js:55:18) at MergeMapSubscriber.Subscriber.next (C:\training\angular4\angular-reddit\node_modules\rxjs\internal\Subscriber.js:64:18) at TapSubscriber._next (C:\training\angular4\angular-reddit\node_modules\rxjs\internal\operators\tap.js:62:26) at TapSubscriber.Subscriber.next (C:\training\angular4\angular-reddit\node_modules\rxjs\internal\Subscriber.js:64:18) at MergeMapSubscriber.notifyNext (C:\training\angular4\angular-reddit\node_modules\rxjs\internal\operators\mergeMap.js:84:26) at InnerSubscriber._next (C:\training\angular4\angular-reddit\node_modules\rxjs\internal\InnerSubscriber.js:25:21) at InnerSubscriber.Subscriber.next (C:\training\angular4\angular-reddit\node_modules\rxjs\internal\Subscriber.js:64:18) at MapSubscriber._next (C:\training\angular4\angular-reddit\node_modules\rxjs\internal\operators\map.js:52:26)

I'm New to Angular. Can anyone help me?

1
@AniketAvhad i try that answer but it give me another error, This Error : "Local workspace file ('angular.json') could not be found. Error: Local workspace file ('angular.json') could not be found." but angular.json file is already in that folderFahim Khan
try "ng build --prod base-href /" this command also target the productionAniket Avhad
@AniketAvhad "Project 'base-href' could not be found in workspace. Error: Project 'base-href' could not be found in workspace."Fahim Khan
If you are using angular 6 then you have to use...'ng build --configuration=production --base-href /'Aniket Avhad

1 Answers

0
votes

In angular 6 version --target replace with --configuration or -c

use below command,

ng build --configuration=production --base-href /

OR

ng build --c=production --base-href /