Internal Error when Installing [email protected] in the project...
Link to the code that reproduces this issue or a replay of the bug https://github.com/xmasuhai/test-vite
Reproduction steps
cd test-vite
corepack use pnpm@latest-10
Describe the Bug
$ corepack use pnpm@latest
Internal Error: Server answered with HTTP 404 when performing the request to https://registry.npmmirror.com//pnpm; for troubleshooting help, see https://github.com/nodejs/corepack#troubleshooting
at fetch (D:\software\nvm\v22.15.0\node_modules\corepack\dist\lib\corepack.cjs:22058:11)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async fetchAsJson (D:\software\nvm\v22.15.0\node_modules\corepack\dist\lib\corepack.cjs:22065:20)
at async fetchAvailableTags (D:\software\nvm\v22.15.0\node_modules\corepack\dist\lib\corepack.cjs:22005:20)
at async fetchAvailableTags2 (D:\software\nvm\v22.15.0\node_modules\corepack\dist\lib\corepack.cjs:22128:14)
at async Engine.resolveDescriptor (D:\software\nvm\v22.15.0\node_modules\corepack\dist\lib\corepack.cjs:22981:20)
at async UseCommand.execute (D:\software\nvm\v22.15.0\node_modules\corepack\dist\lib\corepack.cjs:23457:22)
at async UseCommand.validateAndExecute (D:\software\nvm\v22.15.0\node_modules\corepack\dist\lib\corepack.cjs:20258:22)
at async _Cli.run (D:\software\nvm\v22.15.0\node_modules\corepack\dist\lib\corepack.cjs:21195:18)
at async Object.runMain (D:\software\nvm\v22.15.0\node_modules\corepack\dist\lib\corepack.cjs:23642:19)
Which Node.js version are you using? 22.15.0
Which operating systems have you used win11
@xmasuhai
It looks like you have the environment variable COREPACK_NPM_REGISTRY set to https://registry.npmmirror.com/. Is that correct?
If yes, have you tried setting it to https://registry.npmmirror.com instead (without the trailing / character).
It looks like there are 2 issues involved:
- The Chinese npm mirror https://registry.npmmirror.com/ rejects the URL https://registry.npmmirror.com//pnpm whereas the official npm registry https://registry.npmjs.org accepts the URL https://registry.npmjs.org//pnpm and Corepack is then able to install:
Installing [email protected] from https://registry.npmjs.org//pnpm/-/pnpm-10.10.0.tgz
- Corepack should not be building the URL with a double slash
//. It should strip it down to https://registry.npmmirror.com/pnpm instead. See https://github.com/nodejs/corepack/issues/711
Relates also to https://github.com/nodejs/corepack/issues/535, https://github.com/nodejs/corepack/issues/540 and https://github.com/nodejs/corepack/issues/458
@xmasuhai
If your problem is resolved, you can close this issue with the button below.
Since there hasn't been any response, I suggest to close this issue.