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

deno install fails for private npm package in workspace #28374

Closed
ansemb opened this issue Mar 3, 2025 · 3 comments · Fixed by #28401
Closed

deno install fails for private npm package in workspace #28374

ansemb opened this issue Mar 3, 2025 · 3 comments · Fixed by #28401
Assignees

Comments

@ansemb
Copy link

ansemb commented Mar 3, 2025

Running deno install fails when referencing a npm package from workspace, when the package is not published.

NOTE: running the file deno run modules/some-other-tool/index.ts works fine, so it's resolving the package during runtime.

repro:

we have:

|
├─ modules/some-other-tool
├─ packages/some-private-tool
└
  • modules/some-other-tool/deno.json contains:
{
  "name": "@mynamespace/some-other-tool",
  "exports": "./index.ts",
  "imports": {
    "@mynamespace/some-private-tool": "npm:@mynamespace/some-private-tool"
  }
}

Runing deno install returns:

❯ deno install
error: npm package '@mynamespace/some-private-tool' does not exist.

Stack backtrace:
   0: std::backtrace::Backtrace::capture
   1: anyhow::error::<impl core::convert::From<E> for anyhow::Error>::from
   2: deno::tools::pm::cache_deps::cache_top_level_deps::{{closure}}
   3: deno::spawn_subcommand::{{closure}}
   4: <deno_unsync::tokio::task::MaskFutureAsSend<F> as core::future::future::Future>::poll
   5: tokio::runtime::task::raw::poll
   6: deno::main
   7: std::sys::backtrace::__rust_begin_short_backtrace
   8: _main

deno 2.2.2 (stable, release, aarch64-apple-darwin)
v8 13.4.114.9-rusty
typescript 5.7.3

@dsherret
Copy link
Member

dsherret commented Mar 3, 2025

deno install doesn't support pnpm workspaces. You can probably make it work by adding a "workspaces" property to the package.json:

{
  "workspaces": ["apps/*", "packages/*"]
}

@dsherret dsherret changed the title deno install fails for private npm package (using workspace) deno install fails for private npm package in pnpm workspace Mar 3, 2025
@ansemb
Copy link
Author

ansemb commented Mar 3, 2025

Thanks for answering.

I've updated package.json, but I'm still getting the same error.

@dsherret dsherret changed the title deno install fails for private npm package in pnpm workspace deno install fails for private npm package in workspace Mar 3, 2025
@dsherret
Copy link
Member

dsherret commented Mar 3, 2025

Oh, that should work. I guess it tries to download it still even though it should use the workspace member.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants