diff --git a/packages/create-react-app/index.js b/packages/create-react-app/index.js index fda95f1c041..e3db7131759 100755 --- a/packages/create-react-app/index.js +++ b/packages/create-react-app/index.js @@ -163,9 +163,13 @@ function install(useYarn, dependencies, verbose, isOnline) { command = 'yarnpkg'; args = [ 'add', - '--exact', - isOnline === false && '--offline' - ].concat(dependencies); + '--exact' + ]; + + if (isOnline === false) + args.append('--offline'); + + args = args.concat(dependencies); if (!isOnline) { console.log(chalk.yellow('You appear to be offline.'));