Skip to content

fix: rename bin entry to valid name for Yarn 4 (Berry) compatibility#717

Open
bmbferreira wants to merge 1 commit intotestomatio:2.xfrom
bmbferreira:fix/yarn4-bin-name
Open

fix: rename bin entry to valid name for Yarn 4 (Berry) compatibility#717
bmbferreira wants to merge 1 commit intotestomatio:2.xfrom
bmbferreira:fix/yarn4-bin-name

Conversation

@bmbferreira
Copy link
Copy Markdown
Contributor

Summary

Renames the bin entry in package.json from "testomatio/reporter" to "testomatio-reporter".

The forward slash in "testomatio/reporter" is rejected by Yarn 4 (Berry) during the link step:

Error: Invalid ident (testomatio/reporter)

This is a follow-up to PR #617 / issue #446, which removed the @ prefix but left the /, which is still invalid for Yarn Berry's identifier parser.

Why this breaks

  • The npm registry metadata normalizes the bin name (so npm view @testomatio/reporter bin shows "reporter"), which is why npm-based installs work fine
  • However, Yarn 4 reads the raw package.json from inside the tarball, where the original "testomatio/reporter" key is preserved
  • Yarn 4's Sa() ident parser then rejects the slash

What this changes

One line in package.json:

 "bin": {
-    "testomatio/reporter": "./src/bin/cli.js",
+    "testomatio-reporter": "./src/bin/cli.js",

The dash-separated name testomatio-reporter is a valid POSIX command name and preserves the namespacing intent.

Testing

  • Verified locally: yarn add @testomatio/reporter in a Yarn 4.12.0 project now succeeds with this fix applied as a local patch

Fixes #716

Made with Cursor

The bin name "testomatio/reporter" contains a forward slash which is
rejected by Yarn 4's identifier parser during the link step:

  Error: Invalid ident (testomatio/reporter)

PR testomatio#617 partially fixed testomatio#446 by removing the "@" prefix, but the "/"
still makes it invalid for Yarn Berry. Rename to "testomatio-reporter"
which is a valid POSIX command name.

Fixes testomatio#716

Made-with: Cursor
@olexandr13
Copy link
Copy Markdown
Collaborator

Thank you for this report and PR.
You solution breaks the backward compatibility, thus we cannot merge it.
But we try to come up with solution.
@bmbferreira

@olexandr13 olexandr13 self-requested a review February 27, 2026 08:34
@bmbferreira
Copy link
Copy Markdown
Contributor Author

Thank you for this report and PR. You solution breaks the backward compatibility, thus we cannot merge it. But we try to come up with solution. @bmbferreira

@olexandr13 thanks for the quick reply. Yes we can have a different solution. I just want to be able to use latest version using yarn 4 without any hacky patches on my end. 🙇

@bmbferreira
Copy link
Copy Markdown
Contributor Author

@olexandr13 any suggestion here? how can we have this working with yarn berry v4 without any hacks with patches on my end? Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Yarn 4 (Berry) install fails: invalid bin name "testomatio/reporter" contains forward slash

2 participants