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

error: Unsupported lockfile version '4'. #25144

Closed
hastebrot opened this issue Aug 22, 2024 · 4 comments
Closed

error: Unsupported lockfile version '4'. #25144

hastebrot opened this issue Aug 22, 2024 · 4 comments

Comments

@hastebrot
Copy link

hastebrot commented Aug 22, 2024

Version: Deno 1.46.0

It seems deno lint (and other deno subcommands) does not support lockfile version 4 or ignores DENO_FUTURE=1.

Lockfile version 4 was introduced with #25059.

❯ deno task main
Task main DENO_FUTURE=1 deno run main.ts

❯ deno task lint
error: Unsupported lockfile version '4'. Try upgrading Deno or recreating the lockfile at '[REDACTED]/deno.lock'.

deno.jsonc:

{
  "imports": {
    "nanoid": "npm:nanoid@5.0.7"
  },
  "tasks": {
    "main": "DENO_FUTURE=1 deno run main.ts",
    "lint": "DENO_FUTURE=1 deno lint"
  }
}

main.ts:

import { nanoid } from "nanoid";
nanoid();
@lucacasonato
Copy link
Member

You have to run deno task lint and friends with DENO_FUTURE=1. Lockfile 4 is only supported with DENO_FUTURE=1.

@hastebrot
Copy link
Author

Ahh thanks, now I understand. deno task accesses the lockfile and needs DENO_FUTURE=1.

kinghat added a commit to kinghat/kinghat that referenced this issue Sep 7, 2024
@marcomow
Copy link

Is there a way to set DENO_FUTURE=1 flag without having to specify it every time a command is run? I have it set up in the .env file, but it's not being picked up

@lucacasonato
Copy link
Member

You can upgrade to the latest 2.0-rc (deno upgrade rc). It has future enabled by default

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

No branches or pull requests

3 participants