function shouldUseYarn(cliArgs, projectDir) {
  if (cliArgs && cliArgs.npm) {
    return false;
  }
  const yarnVersion = yarn.getYarnVersionIfAvailable();
  if (yarnVersion && yarn.isProjectUsingYarn(projectDir)) {
    log.info('Using yarn ' + yarnVersion);
    return true;
  }
  return false;
}
If true, use yarn instead of the npm client to upgrade the project.