-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
yarn <executable> with workspaces doesn't work anymore #7126
yarn <executable> with workspaces doesn't work anymore #7126
Comments
Hi! ./node_modules/.bin/react-native should be a symlink, and sometimes I have this error because the symlink points to a non-existent file. What does |
Not sure what's with the
|
I was unable to reproduce on 1.15.2:
Could you maybe make a small repro example? Maybe it's only an issue with certain packages? |
I made a minimal repro example here: https://github.com/thallada/yarn-executable-bug I think this is due to using This definitely used to work in yarn as late as |
I have this problem with a monorepo using lerna, yarn workspaces, and typescript. From the root of the project: $ yarn tsc --version
yarn run v1.15.2
$ /path/to/root/node_modules/.bin/tsc --version
Version 2.9.2
$ cd packages/subproject
$ ls -l node_modules/.bin/tsc
lrwxr-xr-x 1 robations staff 43 26 Mar 16:34 node_modules/.bin/tsc -> ../../../../node_modules/typescript/bin/tsc
$ yarn tsc --version
yarn run v1.15.2
$ /path/to/root/node_modules/.bin/tsc --version
Version 2.9.2 # <--- expected Version 3.3.333̇ so looks like the symlink in the subproject is wrong in this case. (I deleted all |
This is occurring for me as well and doesn't appear to be isolated to workspaces. This closed issue is still reproducible on my machine. With this configuration: package.json
Running
However, running |
Sorry for the long delay on getting back to this issue... I changed from a I'll work up a PR to resolve this as soon as I can... |
…nds. Fixes run in workspaces. This fixes a bug that was introduced in yarnpkg#6850 where the bin path was being built only from `config.lockfileFolder`. However in workspaces, bins may not be hoisted to the workspace root, causing bins to not be found. This change adds `config.cwd` to the bin search path, so the `yarn run` command will look in a workspace package's node_modules, as well as the workspace root. fixes yarnpkg#7126
I think I have the same issue as @robations, roughly:
causes The above fix should fix it, but perhaps just not hoisting bin stubs would be more correct? Edit: nope, the trigger isn't quite that simple... |
Hi @rally25rs, mind if I ask if there are any updates on the fix for this? I've run into this when using |
Is there any update on this? It's a pretty significant issue. |
* fix(run): change run command to check cwd/node_modules/.bin for commands. Fixes run in workspaces. This fixes a bug that was introduced in #6850 where the bin path was being built only from `config.lockfileFolder`. However in workspaces, bins may not be hoisted to the workspace root, causing bins to not be found. This change adds `config.cwd` to the bin search path, so the `yarn run` command will look in a workspace package's node_modules, as well as the workspace root. fixes #7126 * modify chagelog
* fix(run): change run command to check cwd/node_modules/.bin for commands. Fixes run in workspaces. This fixes a bug that was introduced in #6850 where the bin path was being built only from `config.lockfileFolder`. However in workspaces, bins may not be hoisted to the workspace root, causing bins to not be found. This change adds `config.cwd` to the bin search path, so the `yarn run` command will look in a workspace package's node_modules, as well as the workspace root. fixes #7126 * modify chagelog
…kg#7151) * fix(run): change run command to check cwd/node_modules/.bin for commands. Fixes run in workspaces. This fixes a bug that was introduced in yarnpkg#6850 where the bin path was being built only from `config.lockfileFolder`. However in workspaces, bins may not be hoisted to the workspace root, causing bins to not be found. This change adds `config.cwd` to the bin search path, so the `yarn run` command will look in a workspace package's node_modules, as well as the workspace root. fixes yarnpkg#7126 * modify chagelog
…kg#7151) * fix(run): change run command to check cwd/node_modules/.bin for commands. Fixes run in workspaces. This fixes a bug that was introduced in yarnpkg#6850 where the bin path was being built only from `config.lockfileFolder`. However in workspaces, bins may not be hoisted to the workspace root, causing bins to not be found. This change adds `config.cwd` to the bin search path, so the `yarn run` command will look in a workspace package's node_modules, as well as the workspace root. fixes yarnpkg#7126 * modify chagelog
What is the current behavior?
I recently upgraded to yarn 1.15.2 from 1.13.0 and now running executables inside
<current_workspace>/node_modules/.bin/
no longer works. It looks like it is always looking for executables in the root workspace.If the current behavior is a bug, please provide the steps to reproduce.
In a repo with yarn workspaces,
cd
into one of the workspaces and try to run a command that only exists in that workspace's./node_modules/.bin
.What is the expected behavior?
That it runs the executable in the current folder's
./node_modules/.bin
.Please mention your node.js, yarn and operating system version.
yarn: v1.15.2
node: v8.14.0
os: macOS Mojave 10.14
The text was updated successfully, but these errors were encountered: