nodejs / corepack

Zero-runtime-dependency package acting as bridge between Node projects and their package managers
MIT License
2.52k stars 165 forks source link

npm install fails with node:20-alpine #384

Closed pimperator closed 7 months ago

pimperator commented 7 months ago

Installing corepack in a container with nodejs version 20.10.0 or 20.11.1 fails since the version string in latest alpine container contains a single 'v' character.

Ways to reproduce: docker run -ti node:20-alpine /bin/sh within the container: npm install --global corepack

On my side I recieve the following:


npm WARN EBADENGINE   package: 'corepack@0.25.0',
npm WARN EBADENGINE   required: { node: '^18.17.1 | >=20.10.0' },
npm WARN EBADENGINE   current: { node: 'v20.11.1', npm: '10.2.4' }
npm WARN EBADENGINE }```

The issue is located here: https://github.com/nodejs/corepack/blob/main/package.json#L13
merceyz commented 7 months ago

fails since the version string in latest alpine container contains a single 'v' character.

It fails since the required range is invalid, fixed in https://github.com/nodejs/corepack/pull/378.

pimperator commented 7 months ago

ah, yes. I can confirm that after your comment it worked perfectly.

npm install --global corepack

changed 1 package in 569ms
npm notice
npm notice New minor version of npm available! 10.2.4 -> 10.4.0
npm notice Changelog: https://github.com/npm/cli/releases/tag/v10.4.0
npm notice Run npm install -g npm@10.4.0 to update!
npm notice
/ # corepack --version
0.25.1