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

Workspaces: linking node_modules/.bin to wrong directory #5827

Open
jdmarshall opened this issue May 15, 2018 · 6 comments
Open

Workspaces: linking node_modules/.bin to wrong directory #5827

jdmarshall opened this issue May 15, 2018 · 6 comments
Assignees
Labels

Comments

@jdmarshall
Copy link

jdmarshall commented May 15, 2018

Yarn 1.6.0, node 8.9.4 on OS X High Sierra

I suspect this is a bug in workspaces but I could be incorrect about that.

I discovered that node_modules/.bin/mocha is linked to the first package in my workspace to use mocha.

However, Yarn also decided to install mocha in node_modules, resulting in this curious little bit of behavior:

$ node_modules/.bin/mocha --version
5.1.1
$ node_modules/mocha/bin/mocha --version
3.5.3

Expected behavior:
The contents of node_modules/.bin should always point to ../../node_modules/*/bin (custom bin: properties notwithstanding).

It makes me wonder if the bin folder is being evaluated in the wrong order, causing it to make decisions on incomplete or simply different information.

Edit: nohoist has no effect on the behavior

@jdmarshall
Copy link
Author

I am still seeing this problem with 1.12

@Mati365
Copy link

Mati365 commented Feb 21, 2019

bug is still existing, plz halp

@jdmarshall
Copy link
Author

I think I checked again in 1.15 and still saw the same issue. This blocks us from using yarn, and npm keeps finding new ways to make the wrong design choices (latest one is 'lock file' not behaving as a lock file).

@Mati365
Copy link

Mati365 commented Mar 20, 2019

@jdmarshall for now I fixed it by removing broken node_modules/ and symlinking root. Ofc in postinstall callback in package json

@AmbuSreedharan
Copy link

This is still an issue with 1.21.

@jdmarshall
Copy link
Author

I'm seeing new behavior with 1.21.1 and I'm wondering if #7755 is involved.

Mocha and a few other things are behaving, but I'm not out of the woods yet. One, node-gyp is bailing out on hashring and/or node-syslog so the install never finishes. npm runs just fine.

For the subset of things that did install, the remaining bin links into my workspace directory:

  • 2 modules tooling modules I have checked out in the workspace (expected behavior)
  • nyc (despite node_modules/nyc existing)
  • pm2 (despite node_modules/pm2 existing)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants