为 pub 命令配置环境变量
Environment variables allow you to customize pub to suit your needs.
- Some of pub’s dependencies are downloaded to the pub cache.
By default, this directory is located under
.pub-cachein your home directory (on macOS and Linux), or in
%LOCALAPPDATA%\Pub\Cache(on Windows). (The precise location of the cache may vary depending on the Windows version.) You can use the
PUB_CACHEenvironment variable to specify another location. For more information, see The system package cache.
- Pub downloads dependencies from the pub.dev site.
To specify the location of a particular mirror server,
PUB_HOSTED_URLenvironment variable. For example:
PUB_HOSTED_URL = http://user:firstname.lastname@example.org:9999