nodejs / corepack

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

[Question]How the 'COREPACK_ENABLE_UNSAFE_CUSTOM_URLS=1` use ? #508

Open uwang opened 2 weeks ago

uwang commented 2 weeks ago

The document mentioned COREPACK_ENABLE_UNSAFE_CUSTOM_URLS=1 can use custom URL to download package manager. But not make detailed description.

I try that:

COREPACK_ENABLE_UNSAFE_CUSTOM_URLS=1 corepack install https://repo.yarnpkg.com/4.1.1/packages/yarnpkg-cli/bin/yarn.js

or

COREPACK_ENABLE_UNSAFE_CUSTOM_URLS=1 corepack prepare https://repo.yarnpkg.com/4.1.1/packages/yarnpkg-cli/bin/yarn.js

Noting worked. I have no idea. Thanks

aduh95 commented 2 weeks ago

Try the following

COREPACK_ENABLE_UNSAFE_CUSTOM_URLS=1 corepack yarn@https://repo.yarnpkg.com/4.1.1/packages/yarnpkg-cli/bin/yarn.js --version

You can also put that URL as "packageManager" in a package.json.