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

jsr: deps not in node_modules #27557

Closed
lishaduck opened this issue Jan 5, 2025 · 1 comment
Closed

jsr: deps not in node_modules #27557

lishaduck opened this issue Jan 5, 2025 · 1 comment
Labels
invalid what appeared to be an issue with Deno wasn't

Comments

@lishaduck
Copy link

Version: Deno 2.x.x (all)

When using jsr: deps via a deno.json file and using "nodeModulesDir": "manual" or (I forget, I think so ?) "nodeModulesDir": "auto" they aren't included in the node_modules dir, which causes issues with Vitest (#23882 (comment)).
When using a package.json with a JSR-enabled .npmrc, deno install works as expected.

I assume you'll want a repro; I need to go hit the hay, so, if so, please ping me so it's at the top of my notifications list tomorrow :)

@dsherret dsherret added the invalid what appeared to be an issue with Deno wasn't label Jan 7, 2025
@dsherret
Copy link
Member

dsherret commented Jan 7, 2025

This is by design. jsr: specifiers in Deno resolve to remote https urls (ex. jsr:@std/[email protected] resolves to https://jsr.io/@std/path/1.0.8/mod.ts) and so they aren't included in the node_modules directory (they can be included locally in a project by turning on "vendor": true in a deno.json, at which point they'll be in the local vendor folder).

That said, it is possible to use JSR packages with a node_modules directory by installing them through npm by adding the following to an .npmrc file:

@jsr:registry=https://npm.jsr.io

Then importing them via an npm:@jsr/... specifier or adding them as a dependency in a package.json file (https://jsr.io/docs/using-packages#adding-a-package)

@dsherret dsherret closed this as not planned Won't fix, can't repro, duplicate, stale Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid what appeared to be an issue with Deno wasn't
Projects
None yet
Development

No branches or pull requests

2 participants