Last post Aug 09, 2018 12:55 AM by bruce (sqlwork.com)
Aug 07, 2018 03:25 PM|armanes|LINK
Hi, I created new project template ASP.Net core 2.1 MVC with Angular in visual studio 2017.
when i go to project -> ClientApp folder directory with cmd . When I want to execute the command like "ng g d arman" , Cmd Give me an error:
'ng' is not recognized as an internal or external command,
operable program or batch file.
I searched the internet but faced with a different reason and confused me
how can i use 'ng's command (for create service , component and etc ... ) in template ASP.Net core 2.1 MVC with Angular with visual studio 2017
Aug 08, 2018 12:37 AM|bruce (sqlwork.com)|LINK
Aug 08, 2018 09:45 AM|armanes|LINK
Yes you are right,When executing this command :
npm install -g @angular/cli
, the 'ng' commands worked correctly.
But a question arose for me, and how does Angular work correctly before it was executed?
Aug 09, 2018 12:55 AM|bruce (sqlwork.com)|LINK
the ng-cli is a command line program installed, that knows how to run angular scripts (its actually a shell script, that need to be in your path). if you look at the package.json, you will see the build command calls the ng-script directly, not the command
if you have a new version of node, you can use npx to run local (package) installed scripts rather than doing a global install.