diff --git a/packages/create-react-app/index.js b/packages/create-react-app/index.js index 7c9394ea37..399bfdd213 100644 --- a/packages/create-react-app/index.js +++ b/packages/create-react-app/index.js @@ -138,7 +138,7 @@ function createApp(name, verbose, version) { function shouldUseYarn() { try { - execSync('yarn --version', {stdio: 'ignore'}); + execSync('yarnpkg --version', {stdio: 'ignore'}); return true; } catch (e) { return false; @@ -149,7 +149,7 @@ function install(packageToInstall, verbose, callback) { var command; var args; if (shouldUseYarn()) { - command = 'yarn'; + command = 'yarnpkg'; args = [ 'add', '--dev', '--exact', packageToInstall]; } else { command = 'npm'; diff --git a/packages/react-scripts/scripts/eject.js b/packages/react-scripts/scripts/eject.js index 2ae89a4530..d97f814eca 100644 --- a/packages/react-scripts/scripts/eject.js +++ b/packages/react-scripts/scripts/eject.js @@ -147,7 +147,7 @@ prompt( if (pathExists.sync(paths.yarnLockFile)) { console.log(cyan('Running yarn...')); fs.removeSync(ownPath); - spawnSync('yarn', [], {stdio: 'inherit'}); + spawnSync('yarnpkg', [], {stdio: 'inherit'}); } else { console.log(cyan('Running npm install...')); fs.removeSync(ownPath); diff --git a/packages/react-scripts/scripts/init.js b/packages/react-scripts/scripts/init.js index c9a4ea14ac..4d0d91e9f8 100644 --- a/packages/react-scripts/scripts/init.js +++ b/packages/react-scripts/scripts/init.js @@ -65,7 +65,7 @@ module.exports = function(appPath, appName, verbose, originalDirectory) { var args; if (useYarn) { - command = 'yarn'; + command = 'yarnpkg'; args = ['add']; } else { command = 'npm';