import shell from 'shelljs';
import chalk from 'chalk';
import ora from 'ora';
import spawn from 'cross-spawn-promise';

const tic = chalk.green('✓');
const tac = chalk.red('✗');

const installYeoman = async () => {
  const spinner = ora('Installing Yeoman...');

  spinner.start();

  let command = 'yarn';
  let args = ['global', 'add', 'yo'];

  if (!shell.which('npm')) {
    command = 'npm';
    args = ['install', '-g', 'yo'];
  }

  const options = {
    shell: true,
    stdio: false,
  };

  try {
    await spawn(command, args, options);

    spinner.stop();

    console.log(`${tic} Yeoman installed!`);
  } catch (error) {
    spinner.stop();

    console.error(`${tac} There was an error while trying to install Yeoman:`, error);
  }
};

export const verifyYeoman = async () => { // eslint-disable-line import/prefer-default-export
  if (!shell.which('yo')) {
    console.error(`${tac} GraphQL CLI requires Yeoman to be installed.`);

    await installYeoman();
  }

  return true;
};

@@ -283,101 +283,13 @@
 %0A%0A  
-let command = 'yarn';%0A  let args = %5B'global', 'add', 'yo'%5D;%0A%0A  if (!shell.which('npm')) %7B%0A   
+const
  com
@@ -304,17 +304,21 @@
 npm';%0A  
- 
+const
  args = 
@@ -342,21 +342,16 @@
  'yo'%5D;%0A
-  %7D%0A%0A
   const 

Remove the yarn checking, as yarn itself is not stable yet and a lot of people are using old versions.