Skip to content

How do I vendor jsr std modules with Deno v2 #26488

@Dmitri-Sintsov

Description

@Dmitri-Sintsov

With Deno v1 deno vendor command I used to build the complete local copy of the project dependencies, then to run it without having to rely on remote access with deno run --no-remote flag.

Trying to vendoring with Deno v2 where deno vendor is removed with the following cli command:

/home/user/.deno/bin/deno install --allow-env --allow-ffi --allow-import --allow-net --allow-read --allow-sys --force --vendor --lock=/home/user/work/djk-sample310/lib/python3.10/site-packages/django_deno/deno/lock.json --entrypoint /home/user/work/djk-sample310/lib/python3.10/site-packages/django_deno/deno/server.ts

it downloads the dependencies successfully, but either these are incomplete or are not always used, because running with --no-remote

/home/user/.deno/bin/deno run --allow-env --allow-ffi --allow-import --allow-net --allow-read --allow-sys --config=/home/user/work/djk-sample310/lib/python3.10/site-packages/django_deno/deno/deno.json --no-remote /home/user/work/djk-sample310/lib/python3.10/site-packages/django_deno/deno/server.ts --host=127.0.0.1 --port=8099

produces the following error:

error: JSR package manifest for '@std/cli' failed to load. A remote specifier was requested: "https://jsr.io/@std/cli/meta.json", but --no-remote is specified.
    at file:///home/user/work/djk-sample310/lib/python3.10/site-packages/django_deno/deno/server.ts:3:27

No matter whether I try to use the latest version:

import { parseArgs } from "jsr:@std/cli/parse-args";

or fixing the version, in hope it would be used from local cache:

import { parseArgs } from "jsr:@std/cli@1.0.6/parse-args";

Metadata

Metadata

Assignees

No one assigned

    Labels

    questiona question about the use of Deno

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions