Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot determine project or target for Architect command Angular

C:\Users\muhiuddin.TOWERTECH\test\testapp>ng build --target=production

or

C:\Users\muhiuddin.TOWERTECH\test\testapp>ng run

When I run a new project or build it give me "Cannot determine project or target for Architect command" error. I am new to Angular. Kindly give me easy solution.

Angular CLI: 6.0.8
Node: 9.3.0
OS: win32 x64
Angular: 6.0.7
>Cannot determine project or target for Architect command.
Error: Cannot determine project or target for Architect command.
    at MergeMapSubscriber._loadWorkspaceAndArchitect.pipe.operators_1.concatMap [as project] (C:\Users\muhiuddin.TOWERTECH\test\testapp\node_modules\@angular\cli\models\architect-command.js:62:27)
    at MergeMapSubscriber._tryNext (C:\Users\muhiuddin.TOWERTECH\test\testapp\node_modules\rxjs\internal\operators\mergeMap.js:65:27)
    at MergeMapSubscriber._next (C:\Users\muhiuddin.TOWERTECH\test\testapp\node_modules\rxjs\internal\operators\mergeMap.js:55:18)
    at MergeMapSubscriber.Subscriber.next (C:\Users\muhiuddin.TOWERTECH\test\testapp\node_modules\rxjs\internal\Subscriber.js:64:18)
    at TapSubscriber._next (C:\Users\muhiuddin.TOWERTECH\test\testapp\node_modules\rxjs\internal\operators\tap.js:62:26)
    at TapSubscriber.Subscriber.next (C:\Users\muhiuddin.TOWERTECH\test\testapp\node_modules\rxjs\internal\Subscriber.js:64:18)
    at MergeMapSubscriber.notifyNext (C:\Users\muhiuddin.TOWERTECH\test\testapp\node_modules\rxjs\internal\operators\mergeMap.js:84:26)
    at InnerSubscriber._next (C:\Users\muhiuddin.TOWERTECH\test\testapp\node_modules\rxjs\internal\InnerSubscriber.js:25:21)
    at InnerSubscriber.Subscriber.next (C:\Users\muhiuddin.TOWERTECH\test\testapp\node_modules\rxjs\internal\Subscriber.js:64:18)
    at MapSubscriber._next (C:\Users\muhiuddin.TOWERTECH\test\testapp\node_modules\rxjs\internal\operators\map.js:52:26)
like image 442
MUHIUDDIN Avatar asked Jul 07 '18 07:07

MUHIUDDIN


5 Answers

Use:

ng serve

See angular CLI docs - https://github.com/angular/angular-cli/wiki

like image 119
Nathan Alard Avatar answered Oct 22 '22 18:10

Nathan Alard


Double check command line syntax. This error can show if ng used instead of npm like when using package.json shortcut scripts.

npm run debug   (Good)
ng run debug    (Bad)
like image 33
SushiGuy Avatar answered Oct 22 '22 18:10

SushiGuy


had this after upgrading to angular 6.

appears like the CLI command has changed to :

ng build --configuration <environment-name>

the migration from 5 to 6 also created a new "angular.json" file which now contains all the different configurations and their names.

like image 7
Nir Avatar answered Oct 22 '22 19:10

Nir


Check out the cli documentation.

I believe you need to specify your project's name in the build command.

ng build [project]

Also you can do the production build with the following command.

ng build [project] --prod

like image 6
bodorgergely Avatar answered Oct 22 '22 20:10

bodorgergely


Update angular.json file. Add defaultProject property (value will be the name of the desired project)

like image 1
Vivek Kasture Avatar answered Oct 22 '22 18:10

Vivek Kasture