`deno install` fails with `jsr:` specifiers in package.json dependencies
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
- Create a directory with the following package.json:
{
"dependencies": {
"@std/path": "jsr:^1.0.9"
}
}
- Run
deno installin 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
~
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.
pnpm seems added support for this one: https://github.com/pnpm/pnpm/issues/8941