Skip to content

Commit 547ad01

Browse files
committed
add —use-npm flag to bypass yarn
1 parent dc95d18 commit 547ad01

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/create-react-app/createReactApp.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ const program = new commander.Command(packageJson.name)
6464
'--scripts-version <alternative-package>',
6565
'use a non-standard version of react-scripts'
6666
)
67+
.option('--use-npm')
6768
.allowUnknownOption()
6869
.on('--help', () => {
6970
console.log(` Only ${chalk.green('<project-directory>')} is required.`);
@@ -133,10 +134,11 @@ createApp(
133134
projectName,
134135
program.verbose,
135136
program.scriptsVersion,
137+
program.useNpm,
136138
hiddenProgram.internalTestingTemplate
137139
);
138140

139-
function createApp(name, verbose, version, template) {
141+
function createApp(name, verbose, version, useNpm, template) {
140142
const root = path.resolve(name);
141143
const appName = path.basename(root);
142144

@@ -159,7 +161,7 @@ function createApp(name, verbose, version, template) {
159161
JSON.stringify(packageJson, null, 2)
160162
);
161163

162-
const useYarn = shouldUseYarn();
164+
const useYarn = useNpm ? false : shouldUseYarn();
163165
const originalDirectory = process.cwd();
164166
process.chdir(root);
165167
if (!useYarn && !checkThatNpmCanReadCwd()) {

0 commit comments

Comments
 (0)