Skip to content

lts/* isn't installing the latest LTS #1153

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
4 of 5 tasks
nex3 opened this issue Oct 29, 2024 · 9 comments
Closed
4 of 5 tasks

lts/* isn't installing the latest LTS #1153

nex3 opened this issue Oct 29, 2024 · 9 comments
Assignees
Labels
bug Something isn't working

Comments

@nex3
Copy link

nex3 commented Oct 29, 2024

Description:

The current Node LTS at time of writing is v22.11.0. If I run nvm install lts/* locally, that's what gets installed. However, when I select lts/* for GitHub actions, I am getting v20.18.0 instead.

You can see this in this CI run, which I've screenshotted for posterity:

image

This is the corresponding action configuration:

  tests:
    name: 'Tests | Node ${{ matrix.node-version }} | ${{ matrix.os }}'
    runs-on: ${{ matrix.os }}-latest

    strategy:
      matrix:
        os: [ubuntu, macos, windows]
        node-version: ['lts/*', 'lts/-1', 'lts/-2']
      fail-fast: false

    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: ${{ matrix.node-version }}
          check-latest: true

Action version:

v4, which is currently 39370e3

Platform:

  • Ubuntu
  • macOS
  • Windows

Runner type:

  • Hosted
  • Self-hosted

Tools version:

See above screenshot.

Repro steps:

See links above.

Expected behavior:

This should install the latest Node.js LTS and the same version as nvm install lts/*, v22.11.0.

Actual behavior:

This is installing v20.18.0.

@nex3 nex3 added bug Something isn't working needs triage labels Oct 29, 2024
@priya-kinthali
Copy link

Hello @nex3 👋,
Thank you for reporting this issue. We will investigate it and get back to you as soon as we have some feedback.

@gowridurgad gowridurgad self-assigned this Oct 30, 2024
@zdm
Copy link

zdm commented Oct 30, 2024

Why it is so?
Do you need to manually add new node versions to the manifest?

@ahosgood
Copy link

Using a .nvmrc file containing lts/jod, I am getting the error:

Error: Unable to find LTS release 'jod' for Node version 'lts/jod'.

From what I can tell, the code in

const aliases = Object.fromEntries(
manifest
.filter(x => x.lts && x.stable === stable)
.map(x => [x.lts!.toLowerCase(), x])
.reverse()
);
should be filtering through https://nodejs.org/dist/index.json to find the latest matching stable release.

I can't seem to find anything with a stable property in that JSON file and I feel that might be why it is failing. 🤔

@ahosgood
Copy link

Looking more closely, is it getting a list of versions from https://github.com/actions/node-versions/blob/main/versions-manifest.json?

  1. private getManifest(): Promise<tc.IToolRelease[]> {
    core.debug('Getting manifest from actions/node-versions@main');
    return tc.getManifestFromRepo(
    'actions',
    'node-versions',
    this.nodeInfo.auth,
    'main'
    );
    }
  2. https://github.com/actions/toolkit/blob/7f5921cdddc31081d4754a42711d71e7890b0d06/packages/tool-cache/src/tool-cache.ts#L589-L632
  3. https://api.github.com/repos/actions/node-versions/git/trees/main
  4. https://github.com/actions/node-versions/blob/main/versions-manifest.json

@ahosgood
Copy link

Yup, it's dependant on this PR: actions/node-versions#191

@zdm
Copy link

zdm commented Oct 30, 2024

It is better to get node versions and codenames from the official node sources - it will always work.
Nobody knows when data, you currently depends on, will be updated, there is no activity there at all.

codenames: https://github.com/nodejs/Release/blob/main/schedule.json

full list: https://nodejs.org/download/release/index.json

@zdm
Copy link

zdm commented Oct 31, 2024

Maintainers from the third-party project dived into a alcoholic trip and life has been stopped.
Very reliable, nothing to say.

@davidglezz
Copy link

Run actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af
Node version file is not JSON file
Resolved .nvmrc as lts/jod
Attempt to resolve LTS alias from manifest...
Error: Unable to find LTS release 'jod' for Node version 'lts/jod'.

@gowridurgad
Copy link
Contributor

Hi @nex3, We apologise for the inconvenience. The PR is now merged, and the version manifest file has been updated. We are now successfully retrieving the latest Node.js LTS version. Attached a screenshot for your reference. We will proceed to close this issue. Please feel free to reopen this issue or create a new one if necessary.

Screenshot 2024-11-04 at 3 55 17 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants