Job name “..getProjectMetadata” does not exist

前端 未结 10 991
死守一世寂寞
死守一世寂寞 2020-12-23 08:34

I updated my angular to v9 and when I try to go back in v8, I receive this error. I have already tried the following:

  • uninstall -global angular/cli
  • un
相关标签:
10条回答
  • 2020-12-23 09:25

    Instead of deleting the whole node_modules folders, just rename it and try

    npm install 
    sudo npm install --unsafe-perm //for macOS
    

    Please find below my angular packages versions -

    "@angular-devkit/build-angular": "0.802.0",
    "@angular-devkit/core": "8.2.0",
    "@angular/animations": "8.2.0",
    "@angular/cli": "8.2.0",
    "@angular/common": "8.2.0",
    "@angular/compiler": "8.2.0",
    "@angular/compiler-cli": "8.2.0",
    "@angular/core": "8.2.0",
    
    0 讨论(0)
  • 2020-12-23 09:27

    Run also npm i @angular-builders/custom-webpack@8.4.1 --save

    For me Occian's answer was not enough, I also had to change @angular-builders/custom-webpack from latest to 8.4.1, because it had build-angular dependency too. This is how to figure it out:

    npm list @angular-devkit/build-angular

    reports-web-client@0.0.0 C:\projects\2778\reports-web-client
    +-- @angular-builders/custom-webpack@9.1.0
    | `-- @angular-devkit/build-angular@0.901.1
    `-- @angular-devkit/build-angular@0.803.8
    

    Which meant, I had 2 versions of the package, and that's why the error would still show up.

    0 讨论(0)
  • 2020-12-23 09:32

    Personally, the best solution is:

    ng update @angular/cli @angular/core
    

    Why? Because sooner or later, you need to upgrade to Angular 9+ and the other solutions are only to downgrade it.

    I was facing the same issue today until I used this solution and this one works perfectly well.

    0 讨论(0)
  • 2020-12-23 09:33

    If you use npm audit fix, find the package which you tried to fix and restore to a stable version and be aware with vulnerabilities.

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