Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
1 task done
nkalinov opened this issue Dec 8, 2023 · 3 comments
Open
1 task done
Labels
bug Something isn't working

Comments

@nkalinov
Copy link

nkalinov commented Dec 8, 2023

Self-service

  • 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 nkalinov added the bug Something isn't working label Dec 8, 2023
@nkalinov nkalinov changed the title [Bug?]: yarn patch-commit ... doesn't work when using custom npmRegistryServer [Bug?]: yarn patch-commit doesn't work when using custom npmRegistryServer Dec 8, 2023
@lukeapage
Copy link

confirm - same issue

@narajaon
Copy link

narajaon commented Feb 7, 2024

same issue

@BasixKOR
Copy link
Contributor

Duplicate of #4711

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants