It seems to be an issue with @angular-devkit/build-angular
..
Try downgrading it to a specific version:
npm i @angular-devkit/[email protected]
Run also npm i @angular-builders/[email protected] --save
For me Occian's answer was not enough, I also had to change @angular-builders/custom-webpack
from latest
to 8.4.1
, because it had build-angular
dependency too. This is how to figure it out:
npm list @angular-devkit/build-angular
[email protected] C:\projects\2778\reports-web-client +-- @angular-builders/[email protected] | `-- @angular-devkit/[email protected] `-- @angular-devkit/[email protected]
Which meant, I had 2 versions of the package, and that's why the error would still show up.
Personally, the best solution is:
ng update @angular/cli @angular/core
Why? Because sooner or later, you need to upgrade to Angular 9+ and the other solutions are only to downgrade it.
I was facing the same issue today until I used this solution and this one works perfectly well.
This command fixes the situation temporarily:
npm i @angular-devkit/[email protected]
My Jenkins build requires me to run the npm audit fix command to download dependencyes. This command makes the same error appear again. Anyone have any idea how to make the audit command ignore angula-devkit?
If you use npm audit fix, find the package which you tried to fix and restore to a stable version and be aware with vulnerabilities.
Use below version for current angular version:
@angular-devkit/[email protected] v6-lts
@angular-devkit/[email protected] v7-lts
@angular-devkit/[email protected] v8-lts
@angular-devkit/[email protected] v9-lts
@angular-devkit/[email protected] v10-lts
see last current tags version @angular-devkit/build-angular
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With