系统环境变量
通过设置某些环境变量,你可以更改 Turborepo 的行为。这对于为不同的环境和机器创建特定的配置非常有用。
¥By setting certain environment variables, you can change Turborepo's behavior. This can be useful for creating specific configurations for different environments and machines.
系统环境变量始终会被直接提供给 turbo
命令的标志值覆盖。
¥System environment variables are always overridden by flag values provided directly to your turbo
commands.
Variable | Description |
---|---|
FORCE_COLOR | Forces color to be shown in terminal logs |
TURBO_API | Set the base URL for Remote Cache. |
| Manually set the path to the |
| Control reading and writing for cache sources. Uses the same syntax as --cache . |
TURBO_CACHE_DIR | Sets the cache directory, similar to using --cache-dir flag. |
TURBO_CI_VENDOR_ENV_KEY | Set a prefix for environment variables that you want excluded from Framework Inference . NOTE: This does not need to be set by the user and should be configured automatically by supported platforms. |
TURBO_DANGEROUSLY_DISABLE_PACKAGE_MANAGER_CHECK | Disable checking the errors and unexpected caching behavior when disabling this check. Use |
TURBO_DOWNLOAD_LOCAL_ENABLED | Enables global |
TURBO_FORCE | Set to |
TURBO_GLOBAL_WARNING_DISABLED | Disable warning when global |
TURBO_PRINT_VERSION_DISABLED | Disable printing the version of |
TURBO_LOG_ORDER | Set the log order.
Allowed values are |
TURBO_LOGIN | Set the URL used to log in to Remote Cache. Only needed for self-hosted Remote Caches that implement an endpoint that dynamically creates tokens. |
TURBO_NO_UPDATE_NOTIFIER | Remove the update notifier that appears when a new version of
|
TURBO_PLATFORM_ENV | A CSV of environment variable keys that are configured in a supported CI environment (Vercel). NOTE: This variable is meant for platforms looking to implement zero-configuration environment variables. You are not meant to use this variable as an end user. |
TURBO_PLATFORM_ENV_DISABLED | Disable checking environment variables configured in your
|
TURBO_PREFLIGHT | Enables sending a preflight request before every cache artifact and analytics request. The follow-up upload and download will follow redirects. Only applicable when Remote Caching is configured. |
TURBO_REMOTE_CACHE_READ_ONLY | Prevent writing to the Remote Cache - but still allow reading. |
TURBO_REMOTE_CACHE_SIGNATURE_KEY | Sign artifacts with a secret key. For more information, visit the Artifact Integrity section . |
TURBO_REMOTE_CACHE_TIMEOUT | Set a timeout in seconds for |
TURBO_REMOTE_CACHE_UPLOAD_TIMEOUT | Set a timeout in seconds for |
TURBO_REMOTE_ONLY | Always ignore the local filesystem cache for all tasks. |
TURBO_RUN_SUMMARY | Generate a Run Summary when you run tasks. |
TURBO_SCM_BASE | Base used by |
TURBO_SCM_HEAD | Head used by |
TURBO_TEAM | The account name associated with your repository. When using Vercel Remote Cache , this is your team's slug. |
TURBO_TEAMID | The account identifier associated with your repository. When using Vercel Remote Cache , this is your team's ID. |
TURBO_TELEMETRY_MESSAGE_DISABLED | Disable the message notifying you that Telemetry is enabled. |
TURBO_TOKEN | The Bearer token for authentication to access Remote Cache. |
TURBO_UI | Enables TUI when passed true or 1, disables when passed false or 0. |
TURBO_CONCURRENCY | Controls concurrency settings in run or watch mode. |
TURBO_SSO_LOGIN_CALLBACK_PORT | Override the default port (9789) used for the SSO login callback server during authentication. |
任务中的环境变量
¥Environment variables in tasks
Turborepo 将在任务执行期间提供以下环境变量:
¥Turborepo will make the following environment variables available within your tasks while they are executing:
变量 | 描述 |
---|---|
TURBO_HASH | 当前正在运行的任务的哈希值。 |
TURBO_IS_TUI | 使用 TUI 时,此变量设置为 true 。 |