berry
berry copied to clipboard
[Bug?]: `yarn patch-commit` doesn't work when using custom `npmRegistryServer`
Self-service
- [X] I'd be willing to implement a fix
Describe the bug
When using a custom registry (Ex. npmRegistryServer: "https://registry.npm.taobao.org") yarn patch-commit doesn't update the lock file, only the package.json.
As a result, yarn install throws
Error: suneditor@npm:2.45.1::__archiveUrl=https%3A%2F%2Fregistry.npmmirror.com%2Fsuneditor%2F-%2Fsuneditor-2.45.1.tgz isn't supported by any available resolver
Maybe the __archiveUrl part is screwing it up somehow?
To reproduce
https://github.com/nkalinov/Yarn-patch-commit-bug/tree/master
-
Use a custom registry. Ex.
npmRegistryServer: "https://registry.npm.taobao.org" -
Install a package. Ex.
yarn add suneditorThe following will be added to lock file:resolution: "suneditor@npm:2.45.1::__archiveUrl=https%3A%2F%2Fregistry.npmmirror.com%2Fsuneditor%2F-%2Fsuneditor-2.45.1.tgz" -
Create patch.
yarn patch suneditor -
(Try to) Commit the patch. Ex.
yarn patch-commit -s /private/var/folders/92/mfhw067s2bqfxt5jqhz194p80000gq/T/xfs-05ec1850/user
Expected: lock file and resolutions field is updated to point to the patch
Actual: Nothing happens.
Environment
System:
OS: macOS 14.1.1
CPU: (12) arm64 Apple M2 Pro
Binaries:
Node: 18.18.0 - /private/var/folders/92/mfhw067s2bqfxt5jqhz194p80000gq/T/xfs-5f1ca8a0/node
Yarn: 4.0.2 - /private/var/folders/92/mfhw067s2bqfxt5jqhz194p80000gq/T/xfs-5f1ca8a0/yarn
npm: 9.8.1 - ~/.nvm/versions/node/v18.18.0/bin/npm
Additional context
No response
confirm - same issue
same issue
Duplicate of #4711