Skip to content

Switch automatically #782

@TheJaredWilcurt

Description

@TheJaredWilcurt

Is there any way to make it so when I clone down a brand new repo that uses devEngines and cd into it, I'm automatically on the correct Node/npm version, via corepack. Example:

{
  "name": "my-project",
  "devEngines": {
    "runtime": {
      "name": "node",
      "version": ">= 24.0.0"
    },
    "packageManager": {
      "name": "npm",
      "version": "11.7.0"
    }
  }
}

I'm fine with a one time series of steps to install corepack and enable it or whatever, but I don't want to have to do any steps at all after that. I should be able to just git clone https://github.com/org/my-project.git && cd my-project && npm i && npm start and know that if that project uses a different version of Node or npm from what I have it will download it automatically and switch to it before doing the npm i.

This is fully possible with Volta (not with devEngines object, but a similar volta object in the package.json). But Volta is no longer maintained. Can Corepack be used as a replacement today, or would it be possible for it to add support for these features? Thanks.

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