Skip to content

Enhancement: fall back to .nvmrc, .node-version or volta.node for the Node.js runtime #628

Done

Description

@vibgrate-team

Context

src/core-open/scanners/node-scanner.ts takes the Node.js runtime only from package.json engines.node. Lots of apps pin Node instead with .nvmrc, .node-version, or "volta": { "node": "20.11.1" } in package.json, and get no runtime or runtime lag in vg scan. (The platform matrix report already reads .nvmrc / .node-version / .tool-versions in src/reporting/scanners/platform-matrix.ts, which is a useful reference.)

What to do

  • When engines.node is missing, use volta.node, then .nvmrc, then .node-version from the package directory.
  • Accept values like v20.11.1, 20, and lts/iron; skip values that can't be mapped to a version instead of guessing.
  • Add unit tests.

Acceptance

  • A package with no engines and .nvmrc v20.11.1 reports runtime 20.11.1 and a runtime lag.
  • engines.node still wins when present.
  • An unmappable .nvmrc value leaves the runtime empty.

Activity

  1. added
    enhancement
    good first issue
    on Nov 10, 2026
  2. vibgrate-team commented on Nov 10, 2026

    @vibgrate-team
    ContributorAuthor

    Confirmed: the Node runtime comes only from pj.engines?.node (line 313 of src/core-open/scanners/node-scanner.ts).

    Fallback order: volta.node from the same package.json, then .nvmrc, then .node-version in the package directory. Strip a leading v, accept bare majors like 20, and map lts/<codename> only if the runtime catalog already knows the codename; otherwise leave the runtime empty. src/reporting/scanners/platform-matrix.ts already reads these files and is a handy reference. This is a nice first issue, so comment if you'd like it assigned.

  3. noahkhomer18 commented on Nov 20, 2026

    @noahkhomer18
    Contributor

    Happy to take this. Fallback order volta.node, .nvmrc, .node-version, mapping lts/<codename> only through the runtime catalog and leaving anything unmappable empty.

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

    enhancementgood first issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions