Reputation: 505
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
Reputation:
if you build the application, then you don't serve it with ng serve
the flag --server
is unknown to me, and to the CLI documentation (--help
)
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)
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