[Bug] `dlx` on packages with a single binary doesn't execute it if the name doesn't match the package
See original GitHub issue- I’d be willing to implement a fix
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)
const installPromise = packageJsonAndInstall({
dependencies: {
},
});
// arrange private registry
await yarn(`config`, `set`, `npmRegistryServer`, `https://pkgs.dev.azure.com/it-casado/yarn-bugs/_packaging/yarn-bugs/npm/registry`);
await yarn(`config`, `set`, `npmRegistries["//pkgs.dev.azure.com/it-casado/yarn-bugs/_packaging/yarn-bugs/npm/registry"].npmAlwaysAuth`, `true`);
await yarn(`config`, `set`, `npmRegistries["//pkgs.dev.azure.com/it-casado/yarn-bugs/_packaging/yarn-bugs/npm/registry"].npmAuthIdent`, `eWFybi1idWdzOnM2Z2o3b3IzZGNicTY1cHVyZHdoZ282bnNoNnljZHRzMm43ZXZ3dG55YW8zc2lmb2F0bWE=`);
// act
const output = await yarn(`dlx`, `@yarnpkg/pnpify`, `--sdk`, `vscode`);
// assert
expect(output).not.stringContaining(`Internal Error: Binary not found (pnpify) for root-workspace`);
To Reproduce (Manual)
- .yarn.yml
npmRegistries:
//pkgs.dev.azure.com/it-casado/yarn-bugs/_packaging/yarn-bugs/npm/registry:
npmAlwaysAuth: true
npmAuthIdent: eWFybi1idWdzOnM2Z2o3b3IzZGNicTY1cHVyZHdoZ282bnNoNnljZHRzMm43ZXZ3dG55YW8zc2lmb2F0bWE=
npmRegistryServer: "https:////pkgs.dev.azure.com/it-casado/yarn-bugs/_packaging/yarn-bugs/npm/registry"
- package.json
{
"name": "SomeProject",
"description": "Some project",
"license": "MIT",
"author": "Author",
"version": "0.0.1",
"devDependencies": {
"typescript": "^4.0.3"
}
}
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):
- OS: [Windows]
- Node version [10.18.3]
- Yarn version [2.3.3]
Issue Analytics
- State:
- Created 3 years ago
- Comments:42 (17 by maintainers)
Top Results From Across the Web
Migration | Yarn - Package Manager
A step-by-step and in-depth migration guide from Yarn 1 (Classic) to Yarn 2 (Berry).
Read more >Advanced package manager features for npm, Yarn, and pnpm
Don't think a lot about your package manager? Learn more in this article about the advances in package manager features you may have...
Read more >Bug listing with status RESOLVED with resolution INVALID as ...
Bug :27 - "Test" status:RESOLVED resolution:INVALID severity:normal ... does not properly handle if gpm doesn't start" status:RESOLVED resolution:INVALID ...
Read more >Packaging Projects | Unreal Engine 4.27 Documentation
If packaging completes successfully, this directory will then contain the packaged project. Confirming the target directory will then initiate the actual ...
Read more >How to troubleshoot app package signature errors - Win32 apps
The package may fail to install due to certificate chaining errors, even if the signing certificate is not self-signed and the root certificate ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
A quick workaround* is to set a custom scope just for
@yarnpkg
in your.yarnrc.yml
:*context: we had the same issue attempting to execute
yarn dlx @yarnpkgdoctor
in a repository exclusively using an Azure Artifacts feed with npm as the upstream.There are two problems. One is the registry (it returns
@yarnpkg/pnpify
as binary name, which isn’t correct - the binary is calledpnpify
), one is Yarn (if there’s a single binary we should use it regardless of the package name, but we don’t).