Invalid rule result: Instance of class Promise

前端 未结 12 1823
野趣味
野趣味 2021-01-17 13:55

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:

<         


        
相关标签:
12条回答
  • 2021-01-17 14:36

    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

    0 讨论(0)
  • 2021-01-17 14:37

    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

    0 讨论(0)
  • 2021-01-17 14:40

    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.

    0 讨论(0)
  • 2021-01-17 14:45

    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.

    0 讨论(0)
  • 2021-01-17 14:45

    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!

    0 讨论(0)
  • 2021-01-17 14:46

    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

    0 讨论(0)
提交回复
热议问题