Skip to content

[Bug] dlx on packages with a single binary doesn't execute it if the name doesn't match the package #2013

@IT-CASADO

Description

@IT-CASADO
  • 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)

  1. .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"
  1. 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]

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingupholdedReal issues without formal reproduction

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions