Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

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.