Skip to content
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

Log Node.js version using #90

Closed
fishcharlie opened this issue Nov 23, 2019 · 14 comments · Fixed by #137
Closed

Log Node.js version using #90

fishcharlie opened this issue Nov 23, 2019 · 14 comments · Fixed by #137
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@fishcharlie
Copy link
Contributor

Couple of things.

First if you specify node-version of 10, does that use the absoute latest version of Node.js v10 (both minor and patch versions)?

Second, does node-version of 10.x use the latest version when taking account patch versions? Or does .x just mean the minor version?

Finally, it'd be great if this action printed the Node.js version it decided to use in the logs of GitHub Actions so developers can determine which Node.js version it decided to use, which would make debugging SO much easier.

Screen Shot 2019-11-22 at 3 49 46 PM

@joshmgross
Copy link
Member

👋 Hey @fishcharlie. Specifying a node-version of 10 and 10.x will have the same result. This follows semver, where 10 == 10.x == 10.x.x, which is effectively "the latest version of Node.js v10 taking into account both minor and patch versions.

Finally, it'd be great if this action printed the Node.js version it decided to use in the logs of GitHub Actions

Great idea! That should be a quick fix.

@bryanmacfarlane bryanmacfarlane self-assigned this Feb 22, 2020
@bryanmacfarlane
Copy link
Member

Yes, it should work with any semver version spec. As part of this issue, I'll make sure it's logged as well. I'll also update the readme / docs

@fishcharlie
Copy link
Contributor Author

Any updates on this? cc/ @bryanmacfarlane @joshmgross

@joshmgross
Copy link
Member

@bryanmacfarlane are you still planning on doing this? If not, I can pick this up.

@bryanmacfarlane
Copy link
Member

@joshmgross - I'm fine with you picking this up. If you do, look at recent commits in setup-go where I did it. I think it should also output npm version.

@fishcharlie
Copy link
Contributor Author

Outputting the npm version too would be amazing!!!

@joshmgross joshmgross added the enhancement New feature or request label Apr 10, 2020
@demian85
Copy link

Can someone please explain why my node version is not 12 as specified?

Part of my config file is

jobs:
  primary:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        node-version: [12.x]

    steps:
      - uses: actions/checkout@v1

      - name: Cache node modules
        uses: actions/cache@v1.1.0
        with:
          path: ~/.npm
          key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
          restore-keys: |
            ${{ runner.os }}-node-
      - name: Node ${{ matrix.node-version }}
        uses: actions/setup-node@v1.1.0
        with:
          node-version: ${{ matrix.node-version }}

      - name: Installing dependencies
        run: npm install

And logging the node version to the console results in node version: 10.20.1

I do not quite understand where is the problem.

@bryanmacfarlane
Copy link
Member

@demian85 can you log a separate issue? I would also try setup-node@v1 to ensure you're getting latest along with bug fixes

Here's a workflow of mind doing @ 12.x and it leads to node 12. https://github.com/bryanmacfarlane/actions-playground/runs/570652210?check_suite_focus=true

@fishcharlie
Copy link
Contributor Author

@joshmgross Would be more than happy to review and/or test a PR for this when you have it up! Thanks so much for helping with this.

@joshmgross
Copy link
Member

PR for this here: #137

@EdJoPaTo
Copy link

EdJoPaTo commented Oct 20, 2021

This was resolved via #137 but its not working anymore?

Log from the used action isnt showing the specific NPM version:

Run actions/setup-node@v2
  with:
    node-version: 16
    always-auth: false
    check-latest: false
    token: ***
Attempting to download 16...
Acquiring 16.11.1 - x64 from https://github.com/actions/node-versions/releases/download/16.11.1-1336322549/node-16.11.1-linux-x64.tar.gz
Extracting ...
/usr/bin/tar xz --strip 1 --warning=no-unknown-keyword -C /home/runner/work/_temp/192ce410-4dad-49a1-99ac-d942052f626f -f /home/runner/work/_temp/5a93bf66-8337-45eb-b047-0b5bb8eab63e
Adding to the cache ...
Done
Run actions/setup-node@v2
  with:
    node-version: 14
    always-auth: false
    check-latest: false
    token: ***
Found in cache @ /opt/hostedtoolcache/node/14.18.0/x64

@joshmgross joshmgross reopened this Nov 2, 2021
@joshmgross
Copy link
Member

Looks like the changes added in #137 were inadvertently removed in #147

@joshmgross joshmgross removed their assignment Nov 2, 2021
@joshmgross joshmgross added the good first issue Good for newcomers label Nov 2, 2021
@dmitry-shibanov
Copy link
Contributor

Hello everyone. We've released a new version 3.5.1 with logging Nodejs version. For now we didn't update the major tag. Could you please confirm that everything works as expected ?

@dmitry-shibanov
Copy link
Contributor

Hello everyone. For now I'm going to close the issue. If you have any concerns feel free to pings us.

krzyk pushed a commit to krzyk/setup-node that referenced this issue Apr 11, 2023
deining pushed a commit to deining/setup-node that referenced this issue Nov 9, 2023
* docs: update README.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

* [auto] docs: update contributors badge

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants