-
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
workspaces "bin" symlinks not created for sub-dependencies #4964
Comments
Is there a temporary workaround for this issue? |
@klaasman You can create a symlink to the root $ cd packages/foo
$ mkdir node_modules
$ ln -s ../../../node_modules/.bin ./node_modules I hope a fix will come soon though... Whenever I switch to |
Another workaround: go back to the root, |
Based on this workaround, it seems that the issue is caused by how |
And worth mentioning, linking does not happen by just |
Hello, @alexeyraspopov thanks for posting that workaround, it does solve this issue at least partially for me. I have 4 packages in my workspace, I deleted every single Can you please give me any hints on how to debug this by myself? Maybe I should start with |
Any movement on this? Only direct dependencies have their bin symlinked from local node_modules/.bin to the root node_modules/.bin.
I would expect yarn to symlink all transitive dependency bins and direct dependency bins to the root level node_modules/.bin dir. |
Any update on this? |
I had to create a Of course, I'd love for this bug to be fixed, but here's the hack in the meantime... #/bin/sh
DIR="$(pwd)"
pushd node_modules/.bin
DIR__BIN="$(pwd)"
# In the case of a git submodule which is also a monorepo
for f in $(find $DIR/packages/*/packages/*/bin/*); do
ln -sf "$(realpath --relative-to="$(pwd)" "$f")"
done
for f in $(find $DIR/packages/*/bin/*); do
ln -sf "$(realpath --relative-to="$(pwd)" "$f")"
done
popd |
I'm trying to understand how is Facebook able to use Yarn in production with these bugs... Is anyone from the team aware of this problem? #4730 doesn't seem to have fixed it |
This was causing CI failures. The underlying problem appears to be yarnpkg/yarn#4964.
This was causing CI failures. The underlying problem appears to be yarnpkg/yarn#4964.
This seems like the correct behaviour to me. If you want to use Can you point to an example of how this works in a non-workspaces setup? |
The same for a child
|
If you use Lerna simple trick is to add following to your {
"postinstall": "lerna link"
} P.S. Side note, keep in mind that after this your monorepo packages will be linked twice (assume packageB requires packageA:
|
@kirill-konshin Interesting. I wonder which sort of symlinking is better? Is the benefit of hoisting only for speed of setup time? |
@trusktr the thing is that not all tools are smart enough to find the binaries at the top level. |
FYI: I build a little tool on top of Lerna to link binaries offered by packages to the top level https://github.com/sebastian-software/link-lerna-package-binaries |
Any other hint on this? I have a Remix starter in a monorepo and I rely a lot on their CLI, it must stay in the right node_modules Edit: I've configure my starter app
This way, I use hoisting for my packages (I have a depcheck to confirm that I didn't miss a dependency before deploying) but I disable it for the Remix starter up, it seems to work ok this way. I still need to figure how to use the "plug and play" mode to avoid node_modules, if that's even possible. This works better, however then running binaries with |
- [x] - Image optimization component moved into standalone package - [x] - generate-arg-types moved into standalone package - one issue with current yarn yarnpkg/yarn#4964 (you need to delete root node_modules, then yarn and yarn build to make generate-arg-types to work) - [x] - move json into `__generated__` folder, (allow import json from __generated__ folders only) - [x] - Icons moved all gen into `__generated__` - [x] - css-data generated content moved to `__generated__`
FYI: I've encountered similar issue like In my case, I added I have no idea why this worked but I found |
Do you want to request a feature or report a bug?
bug
What is the current behavior?
Yarn Workspaces do not create node_modules/.bin symlinks for nested dependencies that have a bin specified in their package.json.
Original Yarn issue: #2874
If the current behavior is a bug, please provide the steps to reproduce.
Create yarn workspace
Create two workspace packages,
one
andtwo
Add
two
as a dependency toone
Add
eslint
as a dependency totwo
Example: chrisblossom/yarn-issue-4964
What is the expected behavior?
one/node_modules/.bin/eslint
symlink existsPlease mention your node.js, yarn and operating system version.
node 8.9.1
Yarn 1.3.2
OSX 10.13.1
The text was updated successfully, but these errors were encountered: