I updated my angular to v9 and when I try to go back in v8, I receive this error. I have already tried the following:
From my experience a new module that you are using is designed for angular9 and you should upgrade your imports if possible to:
"dependencies": {
"@angular/animations": "^9.1.9",
"@angular/cdk": "^9.2.4",
"@angular/common": "^9.1.9",
"@angular/compiler": "^9.1.9",
"@angular/core": "^9.1.9",
"@angular/forms": "^9.1.9",
"@angular/platform-browser": "^9.1.9",
"@angular/platform-browser-dynamic": "^9.1.9",
"@angular/router": "^9.1.9",
...
}
"devDependencies": {
"@angular-devkit/build-angular": "^0.901.7",
"@angular/cli": "^9.1.7",
"@angular/compiler-cli": "^9.1.9",
"@angular/language-service": "^9.1.9",
...
}
I had the same issue and solved it by downgrading @angular-devkit/build-angular.
version to 0.803.24
as Occian Fumnanya Dia said in his answer above
If after downgrading the version you still get the same error, try deleting the folder platforms
and re-run with ionic cordova run <platform>
. Replace <platform>
with android
or ios
.
It will recreate the folder plaforms
with new things.
Hope it helps.
This cmd fixes the problems
npm i @angular-devkit/build-angular@0.803.24
It seems to be an issue with @angular-devkit/build-angular
..
Try downgrading it to a specific version:
npm i @angular-devkit/build-angular@0.803.24
i fixed it by open
package.json file
and update on the next line
@angular-devkit/build-angular": "^0.803.8"
then run
npm i
This command fixes the situation temporarily:
npm i @angular-devkit/build-angular@0.803.24
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?