I work with Angular 7.1.4. I want to generate a new module with the following line;
ng g m order-process
But I encountered an error:
<
make sure that your angular cli version and @schematics/angular should be same then only ng add @angular/pwa < project name same as in angular.json file >
will execute and run successfully and the service worker module will be added to the project
It is an error in node. It works with carrying out 3 steps 1.- Uninstall and reinstall the (last) version of the node 2.- Inside the project, delete the package-lock.json file (it will be automatically regenerated) and the node_modules folder 3.- run npm install to reload the node_modules
This answer is not related to the initial question, but since this is the first hit in google for the error message, I'll leave some information here for everybody seeing this error when upgrading Apollo (apollo-angular
) from 1.x to 2.x with ng update apollo-angular
.
Check if you have installed @angular-devkit/schematics
and if it is the same version as your @angular/cli
package.
If not install with @angular-devkit/schematics@<your.@angular/cli.version>
. Then commit the changes, make sure you don't commit the changed Apollo version from the failed run and try again.
I'd solved my problem. My angular/cli version is 7.0.7 but I was find the @schematics/angular@8.0.3 in package-lock.json. So, I run the "npm install @schematics/angular@7.0.7 --save-dev" command and solved my problem. Thank you for interested.
Angular CLI: 8.0.3 Node: 10.16.0 OS: darwin x64 Angular: 7.2.7
I also encountered this problem, but it was resolved when I chose to reinstall node!I hope I can help you!
Try to install the CLI version 6.0.8 and then install in a clean project try ng add @angular/pwa@0.6.8
Seems like the error hasn't been solved by the core team so in the meanwhile we have to use a lower version