重要通知: 此文档针对的是 Yarn 1 (Classic) 版本。
对于 Yarn 2+ 文档及迁移指南,请访问 yarnpkg.cn。

envvars

Environment variables defined in process.env allow you to configure additional Yarn features.

CHILD_CONCURRENCY

process.env.CHILD_CONCURRENCY=#number#

Controls the number of child processes run in parallel to build node modules.

Setting this number to 1 will cause the node modules to be built sequentially which can avoid linker errors on windows with node-gyp.

npm_config

For backward compatibility with npm, Yarn allows passing down npm configuration via environment variables. For instance, the --build-from-source npm CLI flag becomes: npm_config_build_from_source=true. For more information on configuring npm, refer to the npm-config page.