Angular-cli build (ng build) on Teamcity

Rather than changing your package.json you can use the node.js NPM plugin and the run command:

run build

build it not a default command for NPM so you need the 'run build' which is mapped to ng build in default ng-cli package.json

"scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
},

See image


In order to get ng build work from nodejs plugin for Team city, I have modified the package.json file. In start replace the value with "ng build". And from team city, npm build command will trigger the ng build command.