async function runNpmInstall()

in src/push/run-local.ts [47:72]


async function runNpmInstall(directory) {
  return new Promise<void>((resolve, reject) => {
    const flags = [
      '--no-audit', // Prevent audit checks
      '--no-update-notifier', // Prevent update checks
      '--no-fund', // No need for package funding messages here
      '--package-lock=false', // no need to write package lock here
      '--progress=false', // no need to display progress
    ];

    const npmInstall = spawn('npm', ['install', ...flags], {
      cwd: directory,
      stdio: 'ignore',
    });
    npmInstall.on('close', code => {
      if (code === 0) {
        resolve();
      } else {
        reject(new Error(`npm install failed with exit code ${code}`));
      }
    });
    npmInstall.on('error', err =>
      reject(new Error(`failed to setup: ${err.message}`))
    );
  });
}