[Bug?]: Missing .bin Folder in node_modules with yarn nodeLinker set to pnpm
Self-service
- [ ] I'd be willing to implement a fix
Describe the bug
When using the nodeLinker setting set to pnpm, the .bin folder in node_modules is not created after installing dependencies, unlike when using other configurations.
To reproduce
Using nodeLinker with pnpm
yarn init -2
yarn set version 4
yarn config set nodeLinker pnpm
yarn add eslint
results in the .bin folder not being created.
Using nodeLinker with node-modules
yarn init -2
yarn set version 4
yarn config set nodeLinker node-modules
yarn add eslint
results in the .bin/eslint folder being created
Using pnpm Directly
pnpm init
pnpm install eslint
also results in the .bin/eslint folder being created
Environment
System:
OS: macOS 13.6
CPU: (10) arm64 Apple M2 Pro
Binaries:
Node: 20.7.0 - /private/var/folders/v5/qmd767md03d0f349sr3pqjr80000gn/T/xfs-13fe14d0/node
Yarn: 3.6.3 - /private/var/folders/v5/qmd767md03d0f349sr3pqjr80000gn/T/xfs-13fe14d0/yarn
npm: 10.2.0 - ~/.nvm/versions/node/v20.7.0/bin/npm
pnpm: 8.13.1 - ~/Library/pnpm/pnpm
npmPackages:
jest: 29.7.0 => 29.7.0
Additional context
This behavior is confusing, as some libraries, such as appcenter, rely on executing binaries from the node_modules/.bin/ directory.
I'm seeing this issue as well (w/ [email protected]). ~~This breaks our ability to use tsc, eslint, and prettier on the command-line (among others).~~ Edit: Okay, it doesn't really break our ability to run CLIs, but it does seem to require that we use yarn run to invoke them — E.g. yarn run tsc — which is less than ideal given this issue. 😞
FWIW, I reached out to the yarn support channel on Discord to see if there was a specific reason for this omission. @arcanis responded, "It hasn't been a problem enough to prompt someone to open a PR".
Thank you for the update. We have migrated to pnpm in our architecture, so this issue no longer affects us. If anyone is interested in submitting a pull request to fix this bug, please feel free to do so.
I also have this problem, and even with yarn run it doesn't work. We are trying to migrate Yarn v1 (Classic) to v4 (Berry), but PnP does not work with Nuxt and the pnpm nodeLinker does not create the .bin folder so everything fails after yarn install. We are left with node-modules nodeLinker or migrating to pnpm.