I installed latest Angular CLI and was trying to create a new app i am getting the below error. I uninstalled , cleaned cache , cleaned by forcing it , installed , updated
This happened to me after updating the project from v6 to v7. However, I missed updating @schematics/angular
to a newer version. Apparently, there was some compatibility mismatch that wasn't noted in the package.json
s that caused this issue.
The best way I've found to figure out what the versions of stuff should be is to create a new project with the version of Angular you are trying to use. Once created, look at it's package.json
to figure what versions should be compatible with what.
This worked for me:
npm uninstall -g @angular/cli
rm -rf node_modules
delete package-lock.json
Edit package.json
devDependencies with these package versions:
"@angular/cli": "6.0.8"
,"@angular/compiler-cli": "6.0.4"
,"@angular-devkit/build-ng-packagr": "~0.6.8"
,"@angular-devkit/build-angular": "^0.6.8"
,"@ngrx/schematics": "6.0.1"
,"@nrwl/schematics": "6.0.4"
, (if using nrwl/nx)"ng-packagr": "^3.0.0-rc.2"
,"typescript": "2.9.2"
npm install
I tried the most repeated solution: reinstalling nodejs and angular cli, deleting node_modules and running npm i
, but it did not work.
Finally, I tried upgrading angular schematics and it worked for me:
npm i -g @schematics/angular@7
npm i @schematics/angular@7
I reinstalled NodeJS.
I deleted node_modules
folder from user directory and hit npm install
and it started working
Try this trick, it will work :
Navigate to Parent Folders i.e.C Drive, Users, admin, download respectively and check if any angular files exist [ package.json, node_modules, etc.] and delete them.
In our case was old package: @angular/pwa Once we update it from: 0.6.8 to 0.7.5 everything started working fine.