Skip to content

Locking CLI tools to specific Node.js versions #3595

Description

@zkochan

Describe the user story

As a developer, I want to be able to use a tool that requires an older or newer Node.js version, even if the project uses a different Node.js version.

Describe the solution you'd like

Add a new field to package.json that describes what Node.js version should be used for running a given CLI. For instance:

{
  "dependencies": {
    "eslint": "7"
  },
  "dependenciesMeta": {
    "eslint": {
      "node": "12.17.1"
    }
  }
}

This field will be automatically populated, if the dependency will be installed using the --node option:

pnpm add eslint --node=12.17.1

pnpm will install the given Node.js version using its Node management feature. The command shim generated at node_modules/.bin/eslint will use the specified node version to run eslint.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions