Cannot read property 'entries' of undefined - Angular CLI

后端 未结 13 453
再見小時候
再見小時候 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:28

    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.jsons 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.

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

    This worked for me:

    1. npm uninstall -g @angular/cli

    2. rm -rf node_modules

    3. delete package-lock.json

    4. 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"
    5. npm install

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

    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
    
    0 讨论(0)
  • 2021-01-18 02:36

    I reinstalled NodeJS. I deleted node_modules folder from user directory and hit npm install and it started working

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

    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.

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

    In our case was old package: @angular/pwa Once we update it from: 0.6.8 to 0.7.5 everything started working fine.

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