deno icon indicating copy to clipboard operation
deno copied to clipboard

`deno install` fails with `jsr:` specifiers in package.json dependencies

Open dahlia opened this issue 7 months ago • 1 comments

Summary

deno install command fails when package.json contains dependencies with jsr: specifiers, while other package managers like the latest versions of pnpm handle this correctly.

Environment

  • Deno version: 2.3.3
  • OS: Fedora Linux 42 (Workstation Edition) x86_64

Steps to Reproduce

  1. Create a directory with the following package.json:
{
  "dependencies": {
    "@std/path": "jsr:^1.0.9"
  }
}
  1. Run deno install in the directory

Expected Behavior

The command should successfully install the JSR package, similar to how pnpm install handles it:

Packages: +1
+
Progress: resolved 1, reused 0, downloaded 1, added 1, done

dependencies:
+ @std/path <- @jsr/std__path 1.0.9

Done in 1.1s using pnpm v10.10.0

Actual Behavior

The command fails with the following error:

error: Failed to install '@std/path'
    at file:///.../package.json

Caused by:
    0: Invalid version requirement
    1: Unexpected character.
         jsr:^1.0.9
         ~

dahlia avatar May 23 '25 15:05 dahlia

A new enum variant should be added here: https://github.com/denoland/deno_package_json/blob/fd985669bf55ecf73f566cce2122df44d9d6dd99/src/lib.rs#L67 and then parsed out here: https://github.com/denoland/deno_package_json/blob/fd985669bf55ecf73f566cce2122df44d9d6dd99/src/lib.rs#L109. After that the type system will show where this needs to be handled in Deno itself.

bartlomieju avatar May 28 '25 14:05 bartlomieju

pnpm seems added support for this one: https://github.com/pnpm/pnpm/issues/8941

eser avatar Oct 22 '25 00:10 eser