corepack icon indicating copy to clipboard operation
corepack copied to clipboard

Versions above `v0.25.0` glitches on Node v18.17.1

Open RoyRao2333 opened this issue 1 year ago • 5 comments

I have this in my package.json: "packageManager": "[email protected]".

I originally have corepack v0.22.0 (or v0.23.0 which I don't recall and doesn't matter) and it worked fine. After upgrading to v0.25.2 (then tested v0.25.0), I got this warning at first:

❯ npm i -g [email protected]
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '[email protected]',
npm WARN EBADENGINE   required: { node: '^18.17.1 | >=20.10.0' },
npm WARN EBADENGINE   current: { node: 'v18.17.1', npm: '10.4.0' }
npm WARN EBADENGINE }

changed 1 package in 689ms

❯ corepack -v
0.25.0

Then when I run my project commands:

❯ nr start:weapp
Corepack is about to download https://registry.npmjs.org/pnpm/-/pnpm-7.32.5.tgz.

Do you want to continue? [Y/n] y
Internal Error: Error when performing the request to https://registry.npmjs.org/pnpm/-/pnpm-7.32.5.tgz; for troubleshooting help, see https://github.com/nodejs/corepack#troubleshooting
    at fetch (/Users/royrao/.nvm/versions/node/v18.17.1/lib/node_modules/corepack/dist/lib/corepack.cjs:22887:11)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async fetchUrlStream (/Users/royrao/.nvm/versions/node/v18.17.1/lib/node_modules/corepack/dist/lib/corepack.cjs:22905:20)
    at async installVersion (/Users/royrao/.nvm/versions/node/v18.17.1/lib/node_modules/corepack/dist/lib/corepack.cjs:23075:18)
    at async Engine.ensurePackageManager (/Users/royrao/.nvm/versions/node/v18.17.1/lib/node_modules/corepack/dist/lib/corepack.cjs:23366:32)
    at async executePackageManagerRequest (/Users/royrao/.nvm/versions/node/v18.17.1/lib/node_modules/corepack/dist/lib/corepack.cjs:24222:23)
    at async BinaryCommand.validateAndExecute (/Users/royrao/.nvm/versions/node/v18.17.1/lib/node_modules/corepack/dist/lib/corepack.cjs:21164:22)
    at async _Cli.run (/Users/royrao/.nvm/versions/node/v18.17.1/lib/node_modules/corepack/dist/lib/corepack.cjs:22139:18)
    at async Object.runMain (/Users/royrao/.nvm/versions/node/v18.17.1/lib/node_modules/corepack/dist/lib/corepack.cjs:24265:12)

I had to downgrade corepack to v0.24.1 which works fine. How can I fix this? Much thanks!

RoyRao2333 avatar Feb 27 '24 03:02 RoyRao2333

Can you confirm what's the behavior of v0.25.2?

aduh95 avatar Feb 27 '24 12:02 aduh95

@aduh95 I can confirm this still happens with v0.25.2. We try to install yarn through corepack and also run into:

Internal Error: Error when performing the request to https://registry.npmjs.org/yarn; for troubleshooting help, see https://github.com/nodejs/corepack#troubleshooting

hubofgitongithub avatar Feb 27 '24 15:02 hubofgitongithub

Thanks @hubofgitongithub for confirmation.

@aduh95 Yes. As I described above, I installed v0.25.2 at first which is problematic, so I went on trying v0.25.0 and still no luck.

So both of them should have this issue.

RoyRao2333 avatar Feb 27 '24 15:02 RoyRao2333

image

Still a problem in node v18.19.1

RoyRao2333 avatar Apr 17 '24 07:04 RoyRao2333

Encounter this after upgrading to [email protected]:

https://github.com/pnpm/pnpm/issues/7724

RoyRao2333 avatar Jun 12 '24 01:06 RoyRao2333