[Bug]: New package.json bin entries are not found unless you run yarn install
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 8.1k
- Forks
- 1.3k
- PR merge metrics
- No merged PRs in 30d
Description
Self-service
- I'd be willing to implement a fix
Describe the bug
After chatting with @merceyz, it was discussed that messaging and handling of newly added bin entries could be better. This bug is to keep record that a yarn install is required currently for bin scripts to be called.
To reproduce
- Add the following to a workspace
package.jsonbin:foo-bar-start': './bin/start' - Try to run the new
binlike:yarn workspace @foo/bar foo-bar-start
Expected results:
The foo-bar-start bin is executed.
Actual results:
The foo-bar-start command can't be found.
Solution:
Run yarn install after updating the bin and then run the yarn workspace @foo/bar foo-bar-start again.
Environment
System:
OS: macOS 11.5.2
CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
Binaries:
Node: 12.21.0 - /private/var/folders/dw/bwt394hs3x3d_tk1c00p2mm1qjgl8d/T/xfs-593cb0c2/node
Yarn: 3.0.2 - /private/var/folders/dw/bwt394hs3x3d_tk1c00p2mm1qjgl8d/T/xfs-593cb0c2/yarn
npm: 7.24.2 - ~/.nvm/versions/node/v12.21.0/bin/npm
Additional context
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue by adding a workspace package.json bin entry, then run yarn workspace @foo/bar foo-bar-start before and after yarn install. Trace how Yarn resolves workspace bin commands and verify that newly added entries execute without requiring an install.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- node.js, typescript
- Domain
- cli, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100