src/install-peerdeps.js
function spawnInstall(command, args) {
  return new Promise((resolve, reject) => {
    // Spawn install process
    const installProcess = spawn(command, args, {
      cwd: process.cwd(),
      // Something to do with this, progress bar only shows if stdio is inherit
      // https://github.com/yarnpkg/yarn/issues/2200
      stdio: "inherit"
    });
    installProcess.on("error", err => reject(err));
    installProcess.on("close", code => {
      if (code !== 0) {
        return reject(
          new Error(`The install process exited with error code ${code}.`)
        );
      }
      return resolve();
    });
  });
}
function spawnInstall(command, args) {
  return new Promise((resolve, reject) => {
    // Spawn install process
    const installProcess = spawn(command, args, {
      cwd: process.cwd(),
      // Something to do with this, progress bar only shows if stdio is inherit
      // https://github.com/yarnpkg/yarn/issues/2200
      stdio: "inherit"
    });
    installProcess.on("error", err => reject(err));
    installProcess.on("close", code => {
      if (code !== 0) {
        return reject(
          new Error(`The install process exited with error code ${code}.`)
        );
      }
      return resolve();
    });
  });
}
function spawnInstall ( command , args ) { return new Promise ( ( resolve , reject ) => { // Spawn install process const installProcess = spawn ( command , args , { cwd : process . cwd ( ) , // Something to do with this, progress bar only shows if stdio is inherit // https://github.com/yarnpkg/yarn/issues/2200 stdio : "inherit" } ) ; installProcess . on ( "error" , err => reject ( err ) ) ; installProcess . on ( "close" , code => { if ( code !== 0 ) { return reject ( new Error ( ` ${ code } ` ) ) ; } return resolve ( ) ; } ) ; } ) ; }
Spawns the package manager
@param {string} command - the command to spawn
@returns {Promise} - a Promise which resolves when the install process is finished
Spawns the package manager