Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug?]: Missing .bin Folder in node_modules with yarn nodeLinker set to pnpm #6171

Open
1 task
alex-misch opened this issue Mar 17, 2024 · 3 comments
Open
1 task
Labels
bug Something isn't working

Comments

@alex-misch
Copy link

alex-misch commented Mar 17, 2024

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.
Screenshot 2024-03-17 at 17 28 27

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
Screenshot 2024-03-17 at 17 30 23

Using pnpm Directly

pnpm init
pnpm install eslint

also results in the .bin/eslint folder being created
Screenshot 2024-03-17 at 17 32 22

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.

@alex-misch alex-misch added the bug Something isn't working label Mar 17, 2024
@broofa
Copy link

broofa commented Jul 23, 2024

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

@alex-misch
Copy link
Author

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.

@andresilva-cc
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants