berry icon indicating copy to clipboard operation
berry copied to clipboard

[Bug?]: `yarn patch-commit` doesn't work when using custom `npmRegistryServer`

Open nkalinov opened this issue 1 year ago • 3 comments
trafficstars

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

  1. Use a custom registry. Ex. npmRegistryServer: "https://registry.npm.taobao.org"

  2. Install a package. Ex. yarn add suneditor The 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"

  3. Create patch. yarn patch suneditor

  4. (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

nkalinov avatar Dec 08 '23 13:12 nkalinov

confirm - same issue

lukeapage avatar Dec 30 '23 08:12 lukeapage

same issue

narajaon avatar Feb 07 '24 16:02 narajaon

Duplicate of #4711

BasixKOR avatar Feb 23 '24 06:02 BasixKOR