Skip to content

Prefer node-version-file: package.json over $PATH by default #912

Open
@fregante

Description

@fregante

Description:

- uses: actions/setup-node@v5

Currently this uses what's available in $PATH, but I reckon it should prefer what the user already specified as a compatible node version in the package.json.

Justification:

It feels strange that a project clearly and "natively" specifies what version it's expected to run on, but the environment ignores it, requiring further config.

I love that node-version-file: package.json is possible now, but I wish I didn't have to clutter all of my jobs with

- uses: actions/setup-node@v4
  with: 
    node-version-file: package.json

. . . 


- uses: actions/setup-node@v4
  with: 
    node-version-file: package.json

. . .

- uses: actions/setup-node@v4
  with: 
    node-version-file: package.json

The drawback is that in the rare situation where the user wants to use what's in PATH, as opposed to what's in package.json, now they'd need something like node-version: PATH. But again this feels like it should be the minority.

Are you willing to submit a PR?

Potentially

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestNew feature or request to improve the current logic

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions