Update package installed from git in Yarn 3

Viewed 250

How to update a proprietary dependency installed from Git repo with Yarn 3?

package.json entry:

"@foo/utils": "git+https://gitlab+deploy-token-...:...@gitlab.com/foo/bar.git#ISSUE-6652-some-git-branch",

yarn up @foo/utils results in the following error:

➤ YN0027: @foo/utils@git+https://gitlab+deploy-token-...:...@gitlab.com/foo/bar.git#ISSUE-6652-some-git-branch can't be resolved to a satisfying range

Internal Error: The remote server failed to provide the requested resource

I need to update the package to latest commit in that branch and the only way I currently know is removing entry for this package manually from yarn.lock, but I guess that's not how things should be done.

1 Answers

It's not ideal since it's interactive, but you can run yarn up -i @foo/utils and choose "reuse" to force the package to resolve (and reinstall) from the same git source again.

Related