angularangular-cliangular-devkit

Packages installation failed from 14 to 15 without errors


I'm using yarn 3.3.0 as package manager. What weird is new yarn only support .yarnrc.yml instead of .yarnrc. But angular still try to find the old one. But it's no help removing .yarnrc

❯ ng update @angular/core@15 @angular/cli@15 --verbose --force
Locating potential npmrc files:
Trying 'C:\Users\setti\.npmrc'...found.
Locating potential yarnrc files:
Trying 'C:\Users\setti\.yarnrc'...found.
The installed Angular CLI version is outdated.
Installing a temporary Angular CLI versioned 15.0.0 to perform the update.
× Packages installation failed, see above.

Solution

  • create a .npmrc file in the root folder and try to enable legacy-peers during the update

    legacy-peer-deps=true
    strict-peer-dependencies=false
    

    In npm the key is legacy-peer-deps, in pnpm strict-peer-dependencies. I don't know the name in yarm, maybe same as npm.

    Ensure you run the ng update with the param --allow-dirty --force --verbose