When I try to build my project running the following command:
ng build --environment=prod --aot=false --output-pa
Run npm install inside this project folder to install all dependencies.
Make sure you use the latest version of the CLI (upgrade guide below)
Run ng serve to see the app in action (try npm start in case ng serve fails).
Run the below commands - only use "sudo" on Mac/ Linux.
sudo npm uninstall -g angular-cli @angular/cli
npm cache clean --force
sudo npm install -g @angular/cli
Delete node_modules folder and package-lock.json file from your project directory
Run the below commands in the given order-
npm install
npm install --save-dev @angular-devkit/build-angular
npm link