nodejs / corepack

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

the new version of yarn build reported an error and rolled back to 0.24.1 which returned to normal #427

Closed Lee66 closed 3 months ago

Lee66 commented 3 months ago

18:38:52 INFO:Build start [Pipeline] sh 18:38:52 + node -v 18:38:52 v16.20.2 18:38:52 + npm -v 18:38:53 8.19.4 18:38:53 + yarn build 18:38:53 Type Error: URL.canParse is not a function 18:38:53 at isSupportedPackageManagerDescriptor (/usr/local/lib/node_modules/corepack/dist/lib/corepack.cjs:23041:15) 18:38:53 at Engine.resolveDescriptor (/usr/local/lib/node_modules/corepack/dist/lib/corepack.cjs:23677:10) 18:38:53 at Engine.findProjectSpec (/usr/local/lib/node_modules/corepack/dist/lib/corepack.cjs:23612:41) 18:38:53 at async Engine.executePackageManagerRequest (/usr/local/lib/node_modules/corepack/dist/lib/corepack.cjs:23660:20) 18:38:53 at async BinaryCommand.validateAndExecute (/usr/local/lib/node_modules/corepack/dist/lib/corepack.cjs:21164:22) 18:38:53 at async _Cli.run (/usr/local/lib/node_modules/corepack/dist/lib/corepack.cjs:22139:18) 18:38:53 at async Object.runMain (/usr/local/lib/node_modules/corepack/dist/lib/corepack.cjs:24371:12)

RDIL commented 3 months ago

The latest version of corepack requires Node 18, and you are on node 16, which doesn't have the URL.canParse API.

aduh95 commented 3 months ago

Node.js 16.x is EOL and no longer supported. If you want/need to keep using it, you'd need to either pin Corepack to a specific version that works for you, or patch Corepack, or add polyfills to your runtime if you want to use more recent versions.