-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
NODE_MODULES not created in sub projects #26743
Comments
This specific example seems to be fine. Deno doesn't create a node_modules folder in workspace members unless there's a conflict with something at the root. |
That's fair. This particular issue came from two different places:
Since this doesn't actually represent a problem with |
I've been thinking about this, and I actually think we might want to consider always creating node_modules dirs for the workspace members. The main reason I changed my mind is that right now, you can effectively end up with shadow dependencies. If one workspace member doesn't depend on a package, but another workspace member does, since they're using the same node_modules dir it would still successfully resolve for any member of the workspace at runtime. It shouldn't be too expensive, either, since you're just symlinking the top level dependencies from the workspace root's |
To be super concrete, if
after running
and that works :). Obviously that's a silly example, but the point that dependencies (including peer & parent ones) become hard links means each sub project can be run as if it's completely standing on its own. |
Version: Deno 2.0.4
When creating a Mono repo (with
"nodeModulesDir": "auto"
set in thedeno.json
), thedeno install
command doesn't createnode_modules
in the sub projects. There is only a singleNODE_MODULES
at the root. After a few discussions on Discord, this seems to be a bug.I've created a basic mono repo [1] that follows the layout described in [2].
[1] https://github.com/irbull/deno_mono_repo
[2] https://docs.deno.com/runtime/fundamentals/workspaces/
Steps to reproduce:
deno install
NODE_MODULES
directory at the root (not in any of the sub projects)The text was updated successfully, but these errors were encountered: