Invalid rule result: Instance of class Promise

前端 未结 12 1822
野趣味
野趣味 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:21

    Run npm install @schematics/angular@7.0.7 --save-dev replace version with the same as your @angular/cli (in this scenario, 7.0.7)

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

    My problem was that my node version was on 8.x.x but angular >= 8.x.x requires a node version >= 10.x.x

    Im using nvm to change node version. Install it with like so (check link for windows usage)

    curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.2/install.sh | bash
    

    after installation install node version 10.x.x

    nvm install 10
    

    then switch in terminal like this

    nvm use 10
    
    0 讨论(0)
  • 2021-01-17 14:28

    Deleting existing package-lock.json and node_modules directory helped me running the ng new command without error

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

    Try to generate a blank new project and check if you get the same error there too when creating a module using the CLI.

    If you do, then I'd recommend to re-install angular.

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

    Had this issue while using Using: @angular/cli 8.1.1, @angular-devkit/schematics 8.0.1, Node v8.9.4, Upgrading to Node 10 fixed it.

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

    There seems to be an issue with the angular schematics- use npm install --save @angular/pwa@0.6.8

    Also you can try lowering the pwa version if you face further issues.

    The issue thread on github- https://github.com/angular/angular-cli/issues/11663

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