GithubHelp home page GithubHelp logo

Log Node.js version using about setup-node HOT 14 CLOSED

actions avatar actions commented on August 23, 2024 15
Log Node.js version using

from setup-node.

Comments (14)

joshmgross avatar joshmgross commented on August 23, 2024 5

👋 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.

from setup-node.

joshmgross avatar joshmgross commented on August 23, 2024 3

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

from setup-node.

bryanmacfarlane avatar bryanmacfarlane commented on August 23, 2024 3

@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.

from setup-node.

fishcharlie avatar fishcharlie commented on August 23, 2024 2

@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.

from setup-node.

bryanmacfarlane avatar bryanmacfarlane commented on August 23, 2024

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

from setup-node.

fishcharlie avatar fishcharlie commented on August 23, 2024

Any updates on this? cc/ @bryanmacfarlane @joshmgross

from setup-node.

fishcharlie avatar fishcharlie commented on August 23, 2024

Outputting the npm version too would be amazing!!!

from setup-node.

demian85 avatar demian85 commented on August 23, 2024

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/[email protected]
        with:
          path: ~/.npm
          key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
          restore-keys: |
            ${{ runner.os }}-node-
      - name: Node ${{ matrix.node-version }}
        uses: actions/[email protected]
        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.

from setup-node.

bryanmacfarlane avatar bryanmacfarlane commented on August 23, 2024

@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

from setup-node.

joshmgross avatar joshmgross commented on August 23, 2024

PR for this here: #137

from setup-node.

EdJoPaTo avatar EdJoPaTo commented on August 23, 2024

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

from setup-node.

joshmgross avatar joshmgross commented on August 23, 2024

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

from setup-node.

dmitry-shibanov avatar dmitry-shibanov commented on August 23, 2024

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 ?

from setup-node.

dmitry-shibanov avatar dmitry-shibanov commented on August 23, 2024

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

from setup-node.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.