[Bug]: "command not found" for node module binaries from npm scripts
See original GitHub issueSelf-service
- I’d be willing to implement a fix
Describe the bug
I’m attempting to upgrade a project from Yarn 1 to 2, which was rather easy. The PR is here: https://github.com/milesj/packemon/pull/75
However, many of my NPM scripts fail with a “command not found: beemo” when attempting to run. The scripts look like "lint": "beemo eslint", and the binary does exist (screenshot below).
I tried yarn beemo and yarn run beemo, but those also fail.
~/Projects/packemon yarn2 ± yarn beemo
Usage Error: Couldn't find a script named "beemo".
$ yarn run [--inspect] [--inspect-brk] <scriptName> ...
~/Projects/packemon yarn2 ± yarn run beemo
Usage Error: Couldn't find a script named "beemo".
$ yarn run [--inspect] [--inspect-brk] <scriptName> ...
I’m not sure what to do here. I haven’t seen anything about this in the docs…
To reproduce
This PR: https://github.com/milesj/packemon/pull/75
Environment
System: OS: macOS 11.2.3 CPU: (12) x64 Intel® Core™ i7-9750H CPU @ 2.60GHz Binaries: Node: 16.4.0 - /private/var/folders/3_/4gw29kj089fh24k68n7gxx80000gn/T/xfs-febfc55f/node Yarn: 2.4.2 - /private/var/folders/3/_4gw29kj089fh24k68n7gxx80000gn/T/xfs-febfc55f/yarn npm: 7.18.1 - ~/.nvm/versions/node/v16.4.0/bin/npm
Additional context
Fails locally and in GitHub actions.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:7 (4 by maintainers)

Top Related StackOverflow Question
@merceyz The rationale makes sense, but having the binary in the
.binfolder, but not actually work is extremely confusing.Is this also noted in the docs somewhere? Because this is a rather controversial change.
If anyone stumbled upon this, a workaround here.