Does not link nested dependencies when they are inside the root node_modules folder
See original GitHub issueI 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?
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
How to prevent nested node_modules inside node_modules
Clear Local node_modules folder Cache Once you remove direct dependencies via the package. json dependencies, the packages will be removed from ...
Read more >Nested Dependencies in Frontend - DEV Community
Basically, node looks into every node_modules folder, starting in the module's parent directory and moving up the file tree, until it finds a ......
Read more >Resolving linked dependencies and nested ... - GitHub
I 'm loading webpack from the App folder. Inside that folder, I've specified aurelia.build.resources to include Core . I expect the core ...
Read more >Symlinked `node_modules` structure - PNPM
pnpm's node_modules layout uses symbolic links to create a nested structure of dependencies. Every file of every package inside node_modules is a hard...
Read more >node_modules folder is always marked as "library root" with ...
That's correct. package.json is only once, in root of Node application. Therefore, top-level node_modules directory is intended only for third-party ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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.
MainApp/node_modules
Steps to reproduce
./packages run: yarn install ./MainApp run: yarn install ./MainApp run: linklocal -r --named package-a package-b …/packages/libs
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?