-
Notifications
You must be signed in to change notification settings - Fork 14
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
Does not link nested dependencies when they are inside the root node_modules folder #37
Comments
This might have something to do with how yarn does workspaces. That the shared dependency is placed in the root folder instead of having them in the linked package. Just a wild guess. |
@spoldman can you set a test repo or give some step-by-step instructions so I can reproduce this? |
@spoldman I re-read your question and I believe this is actually expected/correct behaviour. If I understand correctly, you must be trying to You probably shouldn't expect to be able to It's entirely possible that in the future the hoisting algorithm will determine that a sub-dependency can no longer be hoisted, or perhaps an update to the package(s) that dependency is hoisted out of no longer depend on it, and mysteriously your app will no longer be able to require that particular dependency. In other words, anything that requires on If you add |
I created a test repo: https://github.com/spoldman/linklocal-test and I think this is a Yarn only issue. Because everything works fine with NPM. Looks like Yarn puts package-b inside the MainApp/node_modules folder but npm does not. I tested both using workspaces and not and both cases resulted in yarn putting package-b inside MainApp/node_modules folder. Steps to reproduce ./packages run: yarn install Notice that only package-a get liked inside MainApp/node_modules I'm using Yarn 1.9.4 |
@timoxley have you had time to look at the test repo I sent? |
I have a repository that is getting packages from a monorepo and those packages depend on each other. But no matter what I do I'm not able to use linklocal to link those subpackages of the package that I'm importing.
Here is an example:
MainApp dependencies
-> packageA
packageA dependencies :
-> packageB
if I run the following inside the MainApp only node_modules/packageA gets linked not node_modules/packageB
linklocal --named packageA packageB
If I run it with the recursive flag it only links the node_modules/packageA/node_modules/packageB not node_modules/packageB
Should it not also link packageB when the recursive flag is set?
The text was updated successfully, but these errors were encountered: