Force users to opt-in into the package managers they want to support.
As more and more package managers are added to Corepack, it's more and
more unlikely that our users will be interested in _all_ the package
managers Corepack supports, and it is unreasonable to expect Corepack
maintainers would be able to perform security audits.
Yarn publishing its versions on its own was inconvenient for people using private npm mirrors, so it makes sense to offer a way to fallback to the npm store when requested. This diff changes the logic so that we use the `@yarnpkg/cli-dist` package when the `COREPACK_NPM_REGISTRY` variable is set. It should be backward-compatible, since the `registry` field is still the same.
Corepack will now follow the `Location` header when receiving a 30x HTTP status code. This should allow Corepack to work with proxies that redirect to a different URL.
Node.js segfaults when using `npm@>=9.7.0` and `v8-compile-cache`
```console
$ docker run -it node:20.3.0-slim corepack npm@9.7.1 --version
[SIGSEGV]
```
* feat: do not use `~/.node` as default value for `COREPACK_HOME`
Fixes: https://github.com/nodejs/corepack/issues/145
Refs: https://github.com/nodejs/node/issues/43859
* fixup! feat: do not use `~/.node` as default value for `COREPACK_HOME`
* Update sources/folderUtils.ts
Co-authored-by: Kristoffer K. <merceyz@users.noreply.github.com>
* Update README
* migrate old corepack home folder
Co-authored-by: Kristoffer K. <merceyz@users.noreply.github.com>
If a large number of versions are cached on the host system, trying to
read the whole cache at once can be quite memory intensive. Instead, we
can use an iterative approach that doesn't hold the whole directory
content in memory.
This is useful when `DEBUG=corepack` is set because it tells you where it installed to.
Alternatively, we could add this to the `Install finished` debug line at the end.
* chore: update dependencies, remove unused ones
* fix types
* Updates snapshots
* Fixes prepack
* try with Node.js 16.x
* Update more packages
* Upgrade to Jest 28
* Bump other packages
* Bump other packages
* Use Node.js 14.19.2
* Revert "try with Node.js 16.x"
This reverts commit 45aa8a3a96.
This reverts commit 4a275f68b6.
* Use specific Node.js version
* trying something
* Pin exact Node.js version number
* Bump Jest to 28.1.0
* dist-upgrade
* Don't pin Node.js version when it's not necessary
* Update more dependencies
* Update more dependencies
* Revert "Pin exact Node.js version number"
This reverts commit dd72a68061.
Co-authored-by: Maël Nison <nison.mael@gmail.com>