question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Does not link nested dependencies when they are inside the root node_modules folder

See original GitHub issue

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?

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
spoldmancommented, Sep 12, 2018

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 image

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

0reactions
spoldmancommented, Sep 18, 2018

@timoxley have you had time to look at the test repo I sent?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found