Skip to content
Latchkey

actions/setup-node "Could not resolve dist for node-version-file"

setup-node reads the version from the path in node-version-file. A missing file, a path-not-checked-out, or a malformed value leaves no resolvable version.

What this error means

The setup-node step fails with "Could not resolve a version" or cannot find node-version-file.

github-actions
Error: Could not resolve a version from the file: .nvmrc
##[error]The node-version-file was not found.

Common causes

File missing or not checked out

The repo was not checked out, or the path does not point at the version file.

Malformed version value

The file contains a value setup-node cannot parse into a Node version.

How to fix it

Checkout first and point at a valid file

  1. Run actions/checkout before setup-node.
  2. Set node-version-file to a real path with a valid version (.nvmrc or package.json engines).
  3. Re-run the setup step.
.github/workflows/ci.yml
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
  with:
    node-version-file: .nvmrc
    cache: npm

How to prevent it

  • Always checkout before any setup-* that reads a repo file.
  • Keep .nvmrc / engines values in a format setup-node accepts.

Related guides

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