-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[Bug] dlx
on packages with a single binary doesn't execute it if the name doesn't match the package
#2013
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
Comments
This occurs on any project where the monorepo root has |
I'm using the wrong word "repository"! My repository is public, but I'm using a private registry (Azure Artifacts). |
I'm just saying that I ran into this on a project that was using a public registry. I don't think the Azure piece was triggering this bug. Removing 'private: true' from the top level package before installing the SDKs was a usable workaround |
I'll need a repro, because it works here (tested on this very repository). |
So it looks like this repro works as expected if you add 'typescript' as a devDependency. Yesterday the behavior I was seeing was that it would behave like this even with TypeScript as a devDependency. I could be wrong though, maybe I'm gaslighting myself. I remember for sure removing "private: true", and then the SDKs rolled in. |
It would be nice if you could tool SDKs through the CLI, maybe something like
In my projects I'm driving prettier through a build package, not as a direct dep. In order to get the Yarn SDK I need to add prettier as a devDep temporarily. |
Hi all, thanks for quick response. I'm currently preparing some stuff in my Azure Devops (private registry for a dedicated user so that I can create a npmAuthIdent that I can make public. I will use your repository for this by changing the configuration... |
I cloned your repository and added following to .yarn.yml:
Then I see immediately my error! |
You'll want to edit your comment so that other viewers won't get access to your private NPM. Is your azure artifact registry set up to mirror NPM for other packages? This issue may be with Azure. You may also consider using Azure private registries only for specific scopes (e.g.. @my-super-secret-project/library). |
The token in npmAuthIdent is for a specific user with restricted scope to a specific project only in my Azure DevOps for the purpose of this bug. So its fine for now, but I will revoke my token in the next days... Yes, NPM is mirrored as an upstream source for my artifact repository. |
@darthtrevino Did you see the same error after adding my registry configuration? |
I do, but I think this is a different issue than the issue filed. This looks like an issue with dlx. As a workaround you may want to do the following:
|
I used your workaround already and it is working so far. I doesn't know if the issue is related to private azure registry, but this is the only relevant setting for my issue. Let me know, if I can provide you with more details. |
Ahh I know what happens. When using As a workaround, I believe you can move your token into the |
@arcanis ➤ YN0027: @yarnpkg/pnpify@unknown can't be resolved to a satisfying range: If I copy my token to the project configuration or |
The reproduction case in your issue seems broken (ie it neither pass nor fail due to throwing an unmanaged exception):
Remember: any non-Jest exceptions will cause the test to be reported as broken. If you expect something to pass without throwing, you must wrap it into something like |
Quote reply from darthtrevino:
@arcanis Can you also confirm this bug with my repository I tried to reproduce it with Sherlock but had no success. |
Hi! 👋 This issue looks stale, and doesn't feature the Note that we require Sherlock reproductions for long-lived issues (rather than standalone git repositories or similar) because we're a small team. Sherlock gives us the ability to check which bugs are still affecting the master branch at any given point, and decreases the amount of code we need to run on our own machines (thus leading to faster bug resolutions). It helps us help you! 😃 If you absolutely cannot reproduce a bug on Sherlock (for example because it's a Windows-only issue), a maintainer will have to manually add the |
FWIW, working on my team's private repo, I was able to see this same issue, I initially saw it with when running |
Unfortunately I didn't get it work (last year) and that's the reason why I gave up to try to use YARN 2. The one big reason for us using YARN 2 is the concept of PnP (to get rid of node_modules folder). |
Is this related to / a duplicate of #1484 |
Based on the repro you've provided no, I tried your repro but can't reproduce as even |
ok, it's a different error now... I need to check it... |
The command you're running is invalid -yarn dlx [@yarnpkg/pnpify --sdk vscode]
+yarn dlx @yarnpkg/pnpify --sdk vscode |
ok, for a few weeks I revoked my token in npmAuthIdent. Now there is a fresh and valid token configured. To proof that the token is valid I used it to publish my package:
As you can see everything is working fine! Then I tried Then I tried to install the SDK with You can check it with my latest code in my repository. |
Cloned and tested again, everything returns a 401
|
ahhh, sorry!! I forgot to push my changes to GITHUB... Please can you try again |
Your registry is returning the wrong value for the - "bin": "./lib/cli.js",
+ "bin": {"@yarnpkg/pnpify": "./lib/cli.js"} |
I don't see any difference. What are you comparing? I downloaded the .tar file (manually from the website of my Azure registry). Inside that I found this package.json
It's the same value for the I also added the |
Indeed the tar is identical but the response from the registry isn't, compare the response from https://pkgs.dev.azure.com/it-casado/yarn-bugs/_packaging/yarn-bugs/npm/registry/@yarnpkg%2fpnpify vs https://registry.yarnpkg.com/@yarnpkg/pnpify |
You are right. I tried it only the NPM WAY and got the same wrong result. |
@merceyz Many thanks for your help! I created a bug ticket here: |
@merceyz Are you sure that this is not related to YARN!? I can successfully execute following command: |
Don't need to involve npm nor Yarn to reproduce, just compare the output from the two registries. |
Yes, I see the difference. To be honest: I don't know what should be the correct value in a private (upsstream) repository. |
There are two problems. One is the registry (it returns |
That will indeed fix it for
but that is a problem with the registry changing the published data |
dlx
on packages with a single binary doesn't execute it if the name doesn't match the package
I'm not a technical expert on NPM/YARN/REGISTRIES, and I don't know exactly what information Microsoft needs to fix this issue (or at least confirm it as an issue with Azure DevOps Artifacts Feeds). If you can, you can help me by providing more details to my ticket @ Visual Studio Developer Community: Many thanks so far! |
A quick workaround* is to set a custom scope just for npmScopes:
yarnpkg:
npmRegistryServer: "https://registry.yarnpkg.com" *context: we had the same issue attempting to execute |
Uh oh!
There was an error while loading. Please reload this page.
Describe the bug
I cannot run yarn dlx @yarnpkg/pnpify --sdk vscode with a private registry on Azure Artifacts.
Internal Error: Binary not found (pnpify) for root-workspace-0b6124@workspace:.
To Reproduce (Sherlock)
To Reproduce (Manual)
Or use this GITHUB repository: https://github.com/IT-CASADO/yarn_issue_2013_repro
Side notes
My authentication must be fine, because I can run yarn npm publish without any errors and I can see the published package on my private repository.
The used registry on Azure and the token (read-only) exists only for this bug. So there is no security issue here!
Using the default NPM repository works fine for me.
Environment if relevant (please complete the following information):
The text was updated successfully, but these errors were encountered: