lumeland / lume

🔥 Static site generator for Deno 🦕
https://lume.land
MIT License
1.86k stars 85 forks source link

TypeError: Could not find npm package 'highlight.js' matching 11.7.0. Try retrieving the latest npm package information by running with --reload #330

Closed mskian closed 1 year ago

mskian commented 1 year ago

Version

1.13.2

Platform

Ubuntu 20.04

What steps will reproduce the bug?

Build error

deno task build

How often does it reproduce? Is there a required condition?

deno task build

What is the expected behavior?

Build Error

What do you see instead?

TypeError: Could not find npm package 'highlight.js' matching 11.7.0. Try retrieving the latest npm package information by running with --reload
    at async createSite (https://deno.land/x/lume@v1.13.2/cli/run.ts:51:17)
    at async build (https://deno.land/x/lume@v1.13.2/cli/build.ts:28:16)
    at async Command.execute (https://deno.land/x/cliffy@v0.25.4/command/command.ts:1790:7)
    at async (https://deno.land/x/lume@v1.13.2/cli.ts:147:3)

No issues in 1.31.1

oscarotero commented 1 year ago

I had similar issues updating NPM packages. I think it's because Deno caches the npm package internally. You can remove the Deno cache directory (deno info) or run the Lume task with the --reload flag:

{
  "importMap": "./import_map.json",
  "tasks": {
    "lume": "echo \"import 'lume/cli.ts'\" | deno run --reload --unstable -A -",
    "build": "deno task lume",
    "serve": "deno task lume -s"
  }
}

Once you run it with --reload, you can remove the flag because the new package is cached.

oscarotero commented 1 year ago

Probably it's caused by the deno.lock file? Related: https://github.com/denoland/deno/issues/16721

mskian commented 1 year ago

I had similar issues updating NPM packages. I think it's because Deno caches the npm package internally. You can remove the Deno cache directory (deno info) or run the Lume task with the --reload flag:

{
  "importMap": "./import_map.json",
  "tasks": {
    "lume": "echo \"import 'lume/cli.ts'\" | deno run --reload --unstable -A -",
    "build": "deno task lume",
    "serve": "deno task lume -s"
  }
}

Once you run it with --reload, you can remove the flag because the new package is cached.

Fixed...

mskian commented 1 year ago

yes because of deno.lock file deno 1.28 Generate a Lock File Now

oscarotero commented 1 year ago

Probably lume upgrade should remove the deno.lock file.