Skip to content
Latchkey

Nx "The externalDependencies ... could not be found" in CI

A target's inputs declares an externalDependencies entry, and Nx could not match the named npm package to any dependency it knows about. The package name is wrong, or it is not declared in a package.json on the graph.

What this error means

Running or hashing a task fails with "The externalDependencies. [name] could not be found" while Nx is computing the task hash.

Nx
The externalDependencies. "esbuld" could not be found

Common causes

The package name in the input is misspelled

The externalDependencies array lists a package (for example esbuld) that is not an actual dependency, so Nx cannot resolve it for hashing.

The dependency is not declared in any package.json

The package is used but never added to a package.json Nx tracks, so it is absent from the dependency set the input refers to.

How to fix it

Correct the externalDependencies entry

  1. Open the target input that lists externalDependencies.
  2. Fix the package name to match the real npm dependency.
  3. Re-run the task so Nx can hash the input.
project.json
"inputs": [
  "default",
  { "externalDependencies": ["esbuild"] }
]

Declare the dependency in package.json

Add the package to the relevant package.json so it exists in the dependency graph the input references.

Terminal
npm install -D esbuild

How to prevent it

  • List only real, installed packages in externalDependencies inputs.
  • Keep package.json dependencies in sync with what targets actually use.
  • Validate inputs after editing target configuration.

Related guides

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