prudvi raju
prudvi raju

Reputation: 505

execute ng serve pointing to the angular directory from current directory

working with angular2 App, and i am writing .bat scripts to automate the angular build and serving the application, as part of the ng serve. I have to do like

  c:\abc\edf>ng serve --server=d:\angualr2\demoApp

Here demoApp is angular2 and node_modules already installed i need to up the angulap app by my batch script.

Where as everyone knows it works and working for me too.

     d:\angualr2\demoApp>ng serve 

Upvotes: 0

Views: 1186

Answers (1)

user4676340
user4676340

Reputation:

  1. if you build the application, then you don't serve it with ng serve

  2. the flag --server is unknown to me, and to the CLI documentation (--help)

  3. If you have a path issue, start by goign into the right folder of your file explorer with cd D:\angular2\demoApp (not sure about it, I'm more of a Linux man)

  4. ng works because NPM added it to your PATH. If you work on another computer, it won't work. Consider running with the local package with a npm command such as npm run build, where build: "ng build --prod"

Upvotes: 1

Related Questions