Skip to content

"setup-node" incorrectly downloads latest on "ubuntu-slim" #13671

@mikeharder

Description

@mikeharder

Description

On ubuntu-slim, using setup-node with a node-version of 24 or 24.x downloads 24.13.1, instead of using 24.13.0 from the cache. On ubuntu-latest, both 24 and 24.x use the cached version. On both images, leaving version empty "" used the cached 24.13.0.

Also reported at actions/setup-node#1492.

Platforms affected

  • Azure DevOps
  • GitHub Actions - Standard Runners
  • GitHub Actions - Larger Runners

Runner images affected

  • Ubuntu 22.04
  • Ubuntu 24.04
  • Ubuntu Slim
  • macOS 14
  • macOS 14 Arm64
  • macOS 15
  • macOS 15 Arm64
  • macOS 26
  • macOS 26 Arm64
  • Windows Server 2022
  • Windows Server 2025
  • Windows Server 2025 with Visual Studio 2026

Image version and build link

VM Image
  - OS: Linux (x64)
  - Source: Docker
  - Name: ubuntu:24.04
  - Version: 20260120.46.1

Build showing behavior on ubuntu-slim and ubuntu-latest:

https://github.com/mikeharder/test-setup-node/actions/runs/21978003995

Is it regression?

unknown

Expected behavior

ubuntu-latest:

Run actions/setup-node@v6
  with:
    node-version: 24.x
    check-latest: false
    token: ***
    package-manager-cache: true
##[debug]isExplicit: 
##[debug]explicit? false
##[debug]isExplicit: 20.20.0
##[debug]explicit? true
##[debug]isExplicit: 22.22.0
##[debug]explicit? true
##[debug]isExplicit: 24.13.0
##[debug]explicit? true
##[debug]evaluating 3 versions
##[debug]matched: 24.13.0
##[debug]checking cache: /opt/hostedtoolcache/node/24.13.0/x64
##[debug]Found tool in cache node 24.13.0 x64
Found in cache @ /opt/hostedtoolcache/node/24.13.0/x64

Actual behavior

ubuntu-slim:

Run actions/setup-node@v6
  with:
    node-version: 24.x
    check-latest: false
    token: ***
    package-manager-cache: true
##[debug]isExplicit: 
##[debug]explicit? false
##[debug]evaluating 0 versions
##[debug]match not found
Attempting to download 24.x...
Acquiring 24.13.1 - x64 from https://github.com/actions/node-versions/releases/download/24.13.1-21889660756/node-24.13.1-linux-x64.tar.gz
Extracting ...
/usr/bin/tar xz --strip 1 --warning=no-unknown-keyword --overwrite -C /home/runner/work/_temp/59cebe8b-4470-41c9-973c-af5e8e15f687 -f /home/runner/work/_temp/693643e2-4471-4597-b383-bb315dcd6f5e
Adding to the cache ...

Repro steps

name: setup-node

on:
  pull_request:
  workflow_dispatch:

permissions:
  contents: read

jobs:
  test:
    runs-on: ${{ matrix.os }}

    strategy:
      matrix:
        node-version: ['24.x', '24', '']
        os: [ubuntu-slim, ubuntu-latest]

    steps:
      - uses: actions/setup-node@v6
        with:
          node-version: ${{ matrix.node-version }}
      
      - run: node -v

https://github.com/mikeharder/test-setup-node/blob/192c349bd754b02fcb70057fa5ebe9b6315c73a0/.github/workflows/setup-node.yaml

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions