2

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?

8
  • checkout stackoverflow.com/questions/51221135/… this link Commented Aug 24, 2018 at 6:48
  • @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 folder Commented Aug 24, 2018 at 7:42
  • try "ng build --prod base-href /" this command also target the production Commented Aug 24, 2018 at 8:47
  • @AniketAvhad "Project 'base-href' could not be found in workspace. Error: Project 'base-href' could not be found in workspace." Commented Aug 24, 2018 at 9:15
  • If you are using angular 6 then you have to use...'ng build --configuration=production --base-href /' Commented Aug 24, 2018 at 11:30

1 Answer 1

0

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 /

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.