Skip to content
Latchkey

Deno npm: specifier "npm package not found" in CI

Deno tried to resolve an npm: specifier against the npm registry and got nothing. The package name is wrong, private, or the requested version does not exist.

What this error means

The run fails with "error: npm package \"pkg\" does not exist" or "Could not find npm package \"pkg\" matching ...".

deno
error: npm package "lodahs" does not exist.
    at file:///home/runner/work/app/app/src/main.ts:1:19

Common causes

A misspelled or private package name

The npm registry has no public package by that name (a typo), or it is private and the runner has no auth to fetch it.

A version constraint with no published release

The package exists but the requested version range has never been published to npm.

How to fix it

Correct the specifier

  1. Verify the exact package name and a published version on npm.
  2. Fix the npm: specifier or its version range.
  3. Re-run so resolution succeeds.
src/main.ts
import express from "npm:express@^4.19.0";

Configure registry auth for private packages

For a private package, provide the npm auth token so the runner can fetch it.

.github/workflows/ci.yml
- run: deno run -A main.ts
  env:
    NPM_CONFIG_TOKEN: ${{ secrets.NPM_TOKEN }}

How to prevent it

  • Verify npm package names and versions before pinning them.
  • Provide registry auth in CI for private npm packages.
  • Commit the lockfile so npm resolution is deterministic.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →