Skip to content

Better migration path for devEngines.packageManager #11301

Description

@jrmajor

Contribution

Describe the user story

I always define both packageManager and devEngines.packageManager fields in package.json.

  • packageManager:
    • Makes pnpm always use the correct version,
    • Respected by pnpm/action-setup,
    • Makes yarn install throw an error,
    • I think it is used by Vercel.
  • devEngines.packageManager:
    • Makes npm install throw an error.

After upgrading to v11-rc.2, I get the following warning: Cannot use both "packageManager" and "devEngines.packageManager" in package.json. "packageManager" will be ignored.

As I see it, I have two options to get rid of it:

  1. Remove packageManager:
    • Now anyone on v10 won't be automatically switched to v11. This is not an option — my entire team has v10 installed locally.
  2. Remove devEngines.packageManager:
    • Now I'm migrating from the newer standard to the older one,
    • There will be no error when accidentally running npm install.

Alternatively, I can wait for someone on my team to “fix” the warning and break automatic version switching for others.

Describe the solution you'd like

Provide a transition period, where specifying both fields does not result in a warning. Maybe suppress the warning if packageManager and devEngines.packageManager specify the same version, and only show it if there's a conflict.

Not sure if that's the best path forward — I'm open to other solutions.

Describe the drawbacks of your solution

I don't see any.

Describe alternatives you've considered

Telling everyone on my team that automatic version switching only works when you manually upgrade to v11.

Metadata

Metadata

Assignees

No one assigned

    Fields

    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions