feat: use yarn mutex to ensure only one install at a time

This commit is contained in:
Rhys Arkins 2018-02-07 06:21:25 +01:00
parent df69c9e3a2
commit 40859b10e2
2 changed files with 4 additions and 1 deletions

View file

@ -22,7 +22,9 @@ async function generateLockFiles(manager, tmpDir, env) {
lernaVersion = lernaVersion || 'latest';
logger.debug('Using lerna version ' + lernaVersion);
const params =
manager === 'npm' ? '--package-lock-only' : '--ignore-scripts';
manager === 'npm'
? '--package-lock-only'
: '--ignore-scripts --ignore-engines --ignore-platform --mutex network:31879';
const cmd = `${manager} install ${params} && npx lerna@${lernaVersion} bootstrap -- ${params}`;
logger.debug({ cmd });
// TODO: Switch to native util.promisify once using only node 8

View file

@ -57,6 +57,7 @@ async function generateLockFile(tmpDir, env) {
cmd += ' --ignore-scripts';
cmd += ' --ignore-engines';
cmd += ' --ignore-platform';
cmd += ' --mutex network:31879';
cmd += process.env.YARN_MUTEX_FILE
? ` --mutex file:${process.env.YARN_MUTEX_FILE}`
: '';