In your package.json change the devkit builder.
"@angular-devkit/build-angular": "^0.800.1",
to
"@angular-devkit/build-angular": "^0.10.0",
it works for me.
good luck.
Following worked for me
npm uninstall @angular-devkit/build-angular
npm install @angular-devkit/[email protected]
Everyone here is focusing on downgrading @angular-devkit/build-angular to @angular 7.x versions for compatibility, but what they should be doing is to upgrade @angular/cli
to angular 8 versions.
The problem is that the system cli is still stuck at an old version and isn't automatically updated by ng update
(because it is outside the angular controlled project), so it is being left at an incompatible version when trying to access the angular libraries.
Downgrading @angular-devkit/build-angular
just causes more incompatibilities.
npm i --global @angular/cli@latest
will fix the problem without breaking things elsewhere.
Everyone is focusing on downgrading @angular-devkit/build-angular
version to X, or upgrading @angular/cli
version to Y or latest.
However, Please do not blindly suggest an X or Y or latest
as answers. (Though usually, downgrading devkit should be better because upgrading CLI is a breaking change)
The correct version to choose, always depends on your Angular (angular-cli) version.
Angular CLI v8.3.19 -> 0.803.19
Angular CLI v8.3.17 -> 0.803.17
Angular CLI v7.3.8 -> 0.13.8
Angular CLI v6-lts -> 0.8.9
For other specific versions, visit: https://github.com/angular/angular-cli/tags. Find your CLI version, and in some tags, they do mention the corresponding versions for @angular-devkit/**
packages.
Note: If you want to upgrade your CLI version, you should first consider upgrading to latest of your major version, do not simply jump to the next major version.
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