SettingDust
SettingDust

Reputation: 63

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.

Upvotes: 1

Views: 779

Answers (2)

Asitha De Silva
Asitha De Silva

Reputation: 183

Weirdly enough, the only way I was able to get this to work was to run npm install -g yarn --force in the folder that had the package.json/yarn.lock file.

After that I was able to successfully run the ng update

Edit: Faced a similar problem again but this time I did: yarn dlx -p @angular/cli@15 ng update @angular/cli@15 @angular/core@15 --allow-dirty --force

Upvotes: 0

JoniJnm
JoniJnm

Reputation: 722

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

Upvotes: 0

Related Questions