Skip to content
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

[Question] dependencies of dependencies are not installed into node_modules #297

Closed
rotemmiz opened this issue Aug 4, 2016 · 5 comments
Closed

Comments

@rotemmiz
Copy link

rotemmiz commented Aug 4, 2016

I noticed that lerna bootstrap does not install dependencies are not installed into node_modules.

Let's say I have two projects in my repo:

repo
|_ main_project
|_direct-dependency

direct-dependency had lodash as a dependency.

running lerna bootstrap will not install lodash in main-project/node_modules

I have prepared a demo setup:
https://github.com/rotemmiz/lerna-dependency-issue-demo

@gigabo
Copy link
Contributor

gigabo commented Aug 4, 2016

Hi @rotemmiz, thanks for putting together such a thorough report.

This is expected behavior for Lerna, given the current linking strategy for dependencies within the repo. What negative impact is this having for you?

@jamiebuilds jamiebuilds changed the title dependencies of dependencies are not installed into node_modules [Question] dependencies of dependencies are not installed into node_modules Nov 16, 2016
@naorye
Copy link

naorye commented Dec 11, 2016

I get negative impact from that linking strategy :)

I have two projects: A and B where A depends on B (A needs B). Both A and B contain React as a dependency. Executing "lerna bootstrap" installs React both on A and B. When running project A I get an exception that resulted from multiple versions of React.

I believe I miss something or I don't use the best approach for my situation and I appreciate a solution if there is one.

@andreigabreanu
Copy link

I also kind of see this as an issue. Here is a real world example:

Package A depends on "react" externally (via "dependencies" in package.json)
Package B depends on Package A (via "dependencies" in package.json)
Package C depends on Package A and B (via "dependencies" in package.json)

Running lerna bootstrap I would assume I would see in node modules of C a symlink to A and B and "react" installed in the root of C (that's how node would normally run w/o lerna).

Is this something not expected to happen?

@doug-wade
Copy link
Contributor

It is not. For react, hoisting to the monorepo root is the correct solution.

@lock
Copy link

lock bot commented Dec 27, 2018

This thread has been automatically locked because there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Dec 27, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants