can't find compiler ngcc module after upgrading Angular and project

前端 未结 5 944
小鲜肉
小鲜肉 2020-12-29 04:52

I\'ve just upgraded Angular cli and one of my project from 7.0.7 to 7.1.0.

I\'ve followed this post and @Francesco Borzi\'s answer.

now I\'ve tried running my

相关标签:
5条回答
  • 2020-12-29 05:20

    All of that doesn't work for me, I was trying to upgrade from Angular 7 to Angular 8 and here is the working solution for me:

    1. npm outdated.
    2. npm update.
    3. npm install -g npm-check.
    4. npm-check -u --skip-unused.
    5. Upgrade all the outdated packages except the sass ones using npm-check.
    6. npm update.
    7. If you have ViewChild on your application, be sure to edit them to @ViewChild(<name>, {static: true}).
    0 讨论(0)
  • 2020-12-29 05:25

    Hope this will resolve your installation related issues

    ng update @angular/cli @angular/core
    
    0 讨论(0)
  • 2020-12-29 05:29

    Just try the below : 1- ng serve isn't working or ngcc failed just enter :

    the project folder -- app folder -- node_modules -- @angular -- compiler-cli -- ngcc
    

    and delete ngcc lock file. Then ng serve and it will work.

    0 讨论(0)
  • 2020-12-29 05:33

    I got same error and solved this by updating @angular/cli global. like:

    npm uninstall -g @angular/cli
    npm install -g @angular/cli
    

    then tried creating new app and copied some dependencies from package.json file to current project because npm install doesn't install latest version of packages. then

    npm install
    

    this solved my problem but then I found this answer: update angular

    0 讨论(0)
  • 2020-12-29 05:36

    In your package.json file, change the @angular/cli version in devDependencies to:

    "@angular/cli": "7.1.0"
    

    There is a version mismatch between your project and the devDependency. You might have probably used npm audit fix --force or a similar auto update command, which might have updated the devDependencies in "package.json" file.

    You can also use angular cli version 7.3.5 in devDependencies here. Just make sure that the development version and the version mentioned in devDependencies are compatible. Be aware that local anglular/cli version doesn't really matter here.

    Update: After making the change, delete "package-lock.json" and delete the "node modules" folder. Run npm install to install the modules again.

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