Skip to content

Commit 0454543

Browse files
committed
Only use cached yarn.lock if using the default yarn registry
1 parent 77f8df7 commit 0454543

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Diff for: packages/create-react-app/createReactApp.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,10 @@ function createApp(
217217
);
218218

219219
const useYarn = useNpm ? false : shouldUseYarn();
220+
const yarnUsesDefaultRegistry =
221+
execSync('yarn config get registry').toString() ===
222+
'https://registry.yarnpkg.com';
223+
220224
const originalDirectory = process.cwd();
221225
process.chdir(root);
222226
if (!useYarn && !checkThatNpmCanReadCwd()) {
@@ -268,7 +272,7 @@ function createApp(
268272
}
269273
}
270274

271-
if (useYarn) {
275+
if (useYarn && yarnUsesDefaultRegistry) {
272276
fs.copySync(
273277
require.resolve('./yarn.lock.cached'),
274278
path.join(root, 'yarn.lock')

0 commit comments

Comments
 (0)