nodejs / corepack

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

installation failure with Type Error: URL.canParse is not a function #394

Closed ipmincubus1369 closed 5 months ago

ipmincubus1369 commented 5 months ago

Hi team, Did any of you get this error in 0.25.1? Currently reverted to 0.24.1 as a workaround.

yarn install --verbose
Type Error: URL.canParse is not a function
    at parseSpec (/usr/local/lib/node_modules/corepack/dist/lib/corepack.cjs:23613:21)
    at loadSpec (/usr/local/lib/node_modules/corepack/dist/lib/corepack.cjs:23690:11)
    at async findProjectSpec (/usr/local/lib/node_modules/corepack/dist/lib/corepack.cjs:23635:20)
    at async executePackageManagerRequest (/usr/local/lib/node_modules/corepack/dist/lib/corepack.cjs:24209:18)
    at async BinaryCommand.validateAndExecute (/usr/local/lib/node_modules/corepack/dist/lib/corepack.cjs:21164:22)
    at async _Cli.run (/usr/local/lib/node_modules/corepack/dist/lib/corepack.cjs:22139:18)
    at async Object.runMain (/usr/local/lib/node_modules/corepack/dist/lib/corepack.cjs:24265:12)
yarn install failed.
styfle commented 5 months ago

You're probably on an old version of Node.js

Some context is here: https://github.com/nodejs/corepack/pull/359#pullrequestreview-1881042380

Technically, 0.25.0 can introduce breaking changes according to https://semver.org

Major version zero (0.y.z) is for initial development. Anything MAY change at any time. The public API SHOULD NOT be considered stable.

ipmincubus1369 commented 5 months ago

ah ok, we are indeed on older version - V16.