ng serve serves an Angular project via a development server
ng serve
npm start runs an arbitrary command specified in the package's "start" property of its "scripts" object. If no "start" property is specified on the "scripts" object, it will run node server.js.
npm start
It seems like ng serve starts the embedded server whereas npm start starts the Node servers.
Can someone throw some light on it?
npm start will run whatever you have defined for the start command of the scripts object in your package.json file.
start
scripts
package.json
So if it looks like this:
"scripts": { "start": "ng serve" }
Then npm start will run ng serve.
2.1m questions
2.1m answers
60 comments
57.0k users