Skip to content

Support .node-version/.nvmrc file #6

Closed

Description

@bdukes

The actions/setup-node action supports a node-version-file input, which can point to a file that contains the version of node.js to use. It would be great if this action could also support reading the runtime version from a file (other than package.json).

We use a .node-version file to automatically get the correct Node.js version based on folder, using nvs auto. There is a PR to add that support, and if that was merged, I'd be happy for package.json to be the source of truth for the Node.js version instead, but until that point, I'd love if I could keep using .node-version without duplicating that version elsewhere in the codebase.

Activity

  1. rchl-u commented on Aug 5, 2026

    @rchl-u

    nvm also doesn't support reading node version from package-json (and is not likely to support it) thus without support for node-version-file pnpm/setup can't be used as a replacement for actions/setup-node without then also maintaining node version in two places.

  2. alexaka1 commented on Sep 4, 2026

    @alexaka1

    .node-version is supported by Renovate, and it is what I always use to control node in CI.

    Enforcing arbitrary heuristic versions in package.json is a maintenance overhead I would prefer not to take on. So .node-version is the "default" and otherwise our team can flexibly control their own node versions (ie if they please they can use nightlies or higher major versions for tooling features)

    Edit:
    I have checked, and Renovate does not support these fields, so this is not viable for me sadly. https://redirect.github.com/renovatebot/renovate/issues/38067

  3. axel7083 commented on Sep 18, 2026

    @axel7083

    This is a much needed feature, we (https://github.com/podman-desktop/podman-desktop) are currently using both pnpm/action-setup and actions/setup-node in our CI

          - uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0
            name: Install pnpm
            with:
              run_install: false
          - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
            with:
              node-version-file: '.nvmrc'
              cache: 'pnpm'
    

    We would like to move to the pnpm/setup but don't really want to maintain the devEngines.runtime and the .nvmrc file so this would be really nice to have it supported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions