Cannot read property 'entries' of undefined - Angular CLI

后端 未结 13 461
再見小時候
再見小時候 2021-01-18 02:04

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

相关标签:
13条回答
  • 2021-01-18 02:38

    Updating all my angular schematic packages worked for me.

    Angular CLI: 6.2.3
    Node: 8.11.2
    OS: darwin x64
    Angular: 5.2.11
    ... animations, common, compiler, compiler-cli, core, forms
    ... http, platform-browser, platform-browser-dynamic
    ... platform-server, router
    
    Package                           Version
    -----------------------------------------------------------
    @angular-devkit/architect         0.6.8
    @angular-devkit/build-angular     0.6.8
    @angular-devkit/build-optimizer   0.8.3
    @angular-devkit/core              0.8.3
    @angular-devkit/schematics        0.8.3
    @angular/cli                      6.2.3
    @angular/pwa                      0.7.5
    @ngtools/webpack                  6.0.8
    @schematics/angular               0.8.3
    @schematics/update                0.8.3
    rxjs                              5.5.12
    typescript                        2.4.2
    webpack                           4.8.3
    
    0 讨论(0)
  • 2021-01-18 02:40

    I tried the other suggestions here, but ended up removing and re-installing Node.js and NPM.

    Finally did the trick for me.

    0 讨论(0)
  • 2021-01-18 02:42

    In my case @schematics/angular was completely missing from my package.json -- not sure what happened.

    Running

    npm i @schematics/angular --save-dev
    

    Fixed the issue for me.

    0 讨论(0)
  • 2021-01-18 02:48

    Hi Shivprasad Koirala,

    I had the same problem as you but the solution did not do it for me. Frankly speaking, it is a little bit odd that re-installing node.js fixes your problem because it should not conflict with Angular/CLI but in any case, good for you.

    For my case, the solution was a bit different. I had accidentally once tried to create a new project in my username's folder. This was wrong, and I had canceled the procedure but it seems like that it had created one or two things. So in that case the steps are:

    1. Navigate to your username folder by opening windows explorer and typing in the address bar %HomePath%
    2. Check if the file package.json and if the folder node_module exist. If so, you can delete them safely.

    If you have a Linux, again you need to navigate to your home directory and delete both those entries.

    0 讨论(0)
  • 2021-01-18 02:48

    I had the same problem after upgrading @angular/cli to version 6.1.5. Downgrading it to 6.0.8 solved problem.

    My problem had been occurring during ng g lib ...

    0 讨论(0)
  • 2021-01-18 02:50

    I had a similar issue. I tried explicitly installing @schematics/angular and setting my default cli collection using:

    npm i @schematics/angular --save-dev
    ng config cli.defaultCollection @schematics/angular
    

    It did not work for me.

    So instead, since I'm already using ngrx in my project, I opted for @ngrx/schematics as my default.

    npm i @ngrx/schematics -D
    ng config cli.defaultCollection @ngrx/schematics
    

    That worked for me.

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