You have to be inside an angular-cli project in order to use the build command after reinstall of angular-cli December 12, 2022 by Tarik Same as John Pankowicz answer, but in my case I had to run npm install -g @angular/cli@latest for the versions to match.