Buidling the application after having upgraded dependcies to Angular 9 (and having performed necessary code changes) throws an error:
Compiling @ang
I had a similar problem,
in my case updating NodeJS to new version helped.
In my case I installed angular-font-awesome package from npm and then bootstrap, it might got conflicted, I just remove previously installed angular-font-awesome
and then done ng build
I had this issue when I ran ionic build
while the project built just fine with my colleagues. So we ran ng -v
to compare our packages. Turns out I had higher versions of @angular-devkit/build-angular
, @angular-devkit/build-optimizer
and @angular-devkit/build-webpack
, each of them was version 0.1001.2 - our project was running with 0.901.8.
So I ran npm uninstall @angular-devkit/build-angular 0.1001.2
to uninstall it, and npm install @angular-devkit/build-angular 0.901.8
to downgrade. On running ng -v
again, the other 2 had downgraded as well.
Finally, ionic build
was a success! We lived happily thereafter, till we run into different problems.Working packages for our project
I generally advise people to make a manual backup of the project after every succeded deployment (locally) because, when you face this kind of problem (everything related to NGCC errors
) you can just hard delete node_modules
folder and restore it from you last backup
.
and then build again.
Sometimes, when you cannot afford updating nodeJS
to the last version, this solution would be perfect.
This problem (NGCC failed) was encountered by me and my colleague developer on our localhost machines.
It would be important to remark that the dev and prod machines were running well.
In order to solve this problem we've followed the next steps:
I wish this helps you and other people in situations like this.
in case version mismatch.. check first version node js and angular js
then write : npm install => : ng serve
if have port issue : ng server --port 4201