DenoDDeno
Powered by
cameronmC
Denoβ€’2y agoβ€’
1 reply
cameronm

nodeModulesDir with deno workspaces

Hi there,

Running into an issue with deno workspaces. I have created an apps and packages directory in the root of my workspace.

Inside apps I have a web directory containing a sveltekit project.

I have the root deno.json setup like this

{
  "workspace": ["./apps/web"],
  "nodeModulesDir": "auto"
}
{
  "workspace": ["./apps/web"],
  "nodeModulesDir": "auto"
}


When I run deno install, from the apps/web directory, the node_modules folder gets created in the root project directory instead of the apps/web directory.

If I remove the workspace config from the above code snippet like so:

{
  "nodeModulesDir": "auto"
}
{
  "nodeModulesDir": "auto"
}


The node_modules folder gets created in the app/web directory as expected. The documentation is a little sparse, and am wondering if this is expected behaviour.

Wondering if since this folder (apps/web) is not exporting any code, only consuming from other shared packages, that it should not be included in the workspace config in root deno.json ie. workspace config should only include paths to shared packages that are exporting code.
Deno banner
DenoJoin
Chat about Deno, a modern runtime for JavaScript and TypeScript.
20,944Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?

Similar Threads

Workspaces with deno deploy
jhJjh / help
2y ago
Problems with Nested deno.json in Deno Workspaces
staytuned_teamSstaytuned_team / help
12mo ago
Dismiss nodeModulesDir Warning
OIRNOIROOIRNOIR / help
3mo ago
How to set up VS Code with Deno workspaces
Hong MinheeHHong Minhee / help
2y ago