Skip to content

Corepack remains when upgrading to Node.js 25.0.0 #840

@MikeMcC399

Description

@MikeMcC399

Bug Report

Summary

Although Node.js 25.0.0 removed Corepack from Node.js >=25, switching from a Node.js version with bundled Corepack, such as one of the Node.js LTS versions, to Node.js 25.0.0 which does not distribute Corepack, retains the previously installed Corepack version.

Steps to Reproduce

n 20
corepack --version
n 25
corepack --version

Expected Behaviour

Node.js >=25 no longer bundles Corepack with Node.js, so switching to such a version should not preserve the previously installed Corepack version.

The result of switching to Node.js >=25 should also be deterministic. Leaving a previously installed version of Corepack in place means that it is not, because it then depends on what version of Node.js (and therefore what version of Corepack) was previously installed.

Actual Behaviour

Running the steps to reproduce shows Corepack 0.33.0 left over from Node.js 20.19.5 when switching to Node.js 25.0.0

$ n 20
corepack --version
n 25
corepack --version
     copying : node/20.19.5
   installed : v20.19.5 (with npm 10.8.2)
0.33.0
     copying : node/25.0.0
   installed : v25.0.0 (with npm 11.6.2)
0.33.0

Other Information

  • The Corepack README documents the removal of Corepack from the Node.js bundle starting with Node.js 25.0.0.

  • corepack is not removed when downgrading node #789 already discussed this issue in terms of downgrading. The situation with upgrading to Node.js >=25 is new. Given that Corepack is permanently removed from Node.js 25.0.0, and from future versions of Node.js, I suggest that the issue and strategy needs to be revisited.

Configuration Details

$ n --version
10.2.0

$ command -v node
/home/mike/n/bin/node

$ node -p process.platform
linux

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions