From 547ad014da3d5a059aec33ed62b43fafafa7f222 Mon Sep 17 00:00:00 2001 From: Trevor Brindle Date: Sat, 4 Nov 2017 13:47:05 -0400 Subject: [PATCH] =?UTF-8?q?add=20=E2=80=94use-npm=20flag=20to=20bypass=20y?= =?UTF-8?q?arn?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/create-react-app/createReactApp.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/create-react-app/createReactApp.js b/packages/create-react-app/createReactApp.js index 9ff7c08cf9e..e7dbbb35842 100755 --- a/packages/create-react-app/createReactApp.js +++ b/packages/create-react-app/createReactApp.js @@ -64,6 +64,7 @@ const program = new commander.Command(packageJson.name) '--scripts-version ', 'use a non-standard version of react-scripts' ) + .option('--use-npm') .allowUnknownOption() .on('--help', () => { console.log(` Only ${chalk.green('')} is required.`); @@ -133,10 +134,11 @@ createApp( projectName, program.verbose, program.scriptsVersion, + program.useNpm, hiddenProgram.internalTestingTemplate ); -function createApp(name, verbose, version, template) { +function createApp(name, verbose, version, useNpm, template) { const root = path.resolve(name); const appName = path.basename(root); @@ -159,7 +161,7 @@ function createApp(name, verbose, version, template) { JSON.stringify(packageJson, null, 2) ); - const useYarn = shouldUseYarn(); + const useYarn = useNpm ? false : shouldUseYarn(); const originalDirectory = process.cwd(); process.chdir(root); if (!useYarn && !checkThatNpmCanReadCwd()) {