DenoDDeno
Powered by
hosiH
Deno•17mo ago
hosi

`deno install` installs workspace members' npm dependencies, but not jsr dependencies?

In a monorepo setup, does
deno install
deno install
install the dependencies of workspace members?

I couldn't find any mention of this behavior in either the
deno install
deno install
documentation or the workspace documentation, so I'm unsure if this is the expected behavior.

Consider the following monorepo structure:

.
├── deno.json
└── packages
    ├── bar
    │   └── deno.json
    └── foo
        └── deno.json
.
├── deno.json
└── packages
    ├── bar
    │   └── deno.json
    └── foo
        └── deno.json


The contents of each file are as follows:

// deno.json
{
  "workspaces": ["packages/foo", "packages/bar"],
  "vendor": true,
  "nodeModulesDir": "auto"
}

// packages/foo/deno.json
{
  "imports": {
    "@std/encoding": "jsr:@std/encoding@^1.0.5"
  }
}

// packages/bar/deno.json
{
  "imports": {
    "chalk": "npm:chalk@^5.3.0"
  }
}
// deno.json
{
  "workspaces": ["packages/foo", "packages/bar"],
  "vendor": true,
  "nodeModulesDir": "auto"
}

// packages/foo/deno.json
{
  "imports": {
    "@std/encoding": "jsr:@std/encoding@^1.0.5"
  }
}

// packages/bar/deno.json
{
  "imports": {
    "chalk": "npm:chalk@^5.3.0"
  }
}


When I run
deno install
deno install
in the root directory, a
node_modules
node_modules
folder is created there, and
chalk
chalk
is installed, but no
vendor
vendor
directory is created, and
@std/encoding
@std/encoding
isn't installed.

Is this the expected behavior? In other words, is it by design that running
deno install
deno install
in the root directory installs npm dependencies from workspace members but does not install jsr dependencies?
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

Importing from Deno Workspace to NPM workspace
Amin NAIRIAAmin NAIRI / help
16mo ago
Should deno install work with jsr?
ThomasTThomas / help
3y ago
How to install npm dev dependencies?
florentFflorent / help
16mo ago
`npm workspace`'s support with Deno v2
ozzieOozzie / help
14mo ago