react/node_modules/@webpack-cli/utils/lib/spawn-child.js
/**
 *
 * Spawns a new process using the respective package manager
 *
 * @param {String} pkg - The dependency to be installed
 * @param {Boolean} isNew - indicates if it needs to be updated or installed
 * @returns {Function} spawn - Installs the package
 */
Spawns a new process using the respective package manager
@param {String} pkg - The dependency to be installed
@param {Boolean} isNew - indicates if it needs to be updated or installed
@returns {Function} spawn - Installs the package
Spawns a new process using the respective package manager @param { String } pkg - The dependency to be installed @param { Boolean } isNew - indicates if it needs to be updated or installed @returns { Function } spawn - Installs the package
function spawnWithArg(pkg, isNew) {
    const packageManager = get_package_manager_1.getPackageManager();
    let options = [];
    if (packageManager === 'npm') {
        options = [isNew ? 'install' : 'update', '-g', pkg];
    }
    else {
        options = ['global', isNew ? 'add' : 'upgrade', pkg];
    }
    return execa_1.sync(packageManager, options, {
        stdio: 'inherit',
    });
}
function spawnWithArg ( pkg , isNew ) { const packageManager = get_package_manager_1 . getPackageManager ( ) ; let options = [ ] ; if ( packageManager === 'npm' ) { options = [ isNew ? 'install' : 'update' , '-g' , pkg ] ; } else { options = [ 'global' , isNew ? 'add' : 'upgrade' , pkg ] ; } return execa_1 . sync ( packageManager , options , { stdio : 'inherit' , } ) ; }
Spawns a new process using the respective package manager
 @param {String} pkg - The dependency to be installed
 @param {Boolean} isNew - indicates if it needs to be updated or installed
 @returns {Function} spawn - Installs the package
Spawns a new process using the respective package manager @param { String } pkg - The dependency to be installed @param { Boolean } isNew - indicates if it needs to be updated or installed @returns { Function } spawn - Installs the package