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
- Run actions/checkout before setup-node.
- Set node-version-file to a real path with a valid version (.nvmrc or package.json engines).
- Re-run the setup step.
.github/workflows/ci.yml
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: npmHow 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
GitHub Actions setup-node "Unable to find Node version for platform"Fix actions/setup-node "Unable to find Node version for platform" - the requested Node version is not publish…
GitHub Actions "Dependencies lock file is not found" (setup-node cache)Fix GitHub Actions "Dependencies lock file is not found" from setup-node caching - the action could not locat…