Skip to content

Commit 772f4e0

Browse files
committed
Add back call to createApp()
1 parent e62f9ec commit 772f4e0

File tree

1 file changed

+37
-38
lines changed

1 file changed

+37
-38
lines changed

packages/create-react-app/createReactApp.js

Lines changed: 37 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -222,50 +222,49 @@ function init() {
222222
process.exit(1);
223223
}
224224

225-
return;
226-
227225
// We first check the registry directly via the API, and if that fails, we try
228226
// the slower `npm view [package] version` command.
229227
//
230228
// This is important for users in environments where direct access to npm is
231229
// blocked by a firewall, and packages are provided exclusively via a private
232230
// registry.
233-
// eslint-disable-next-line no-unreachable
234-
checkForLatestVersion()
235-
.catch(() => {
236-
try {
237-
return execSync('npm view create-react-app version').toString().trim();
238-
} catch (e) {
239-
return null;
240-
}
241-
})
242-
.then((latest) => {
243-
if (latest && semver.lt(packageJson.version, latest)) {
244-
console.log();
245-
console.error(
246-
chalk.yellow(
247-
`You are running \`create-react-app\` ${packageJson.version}, which is behind the latest release (${latest}).\n\n` +
248-
'We recommend always using the latest version of create-react-app if possible.',
249-
),
250-
);
251-
console.log();
252-
console.log(
253-
'The latest instructions for creating a new app can be found here:\n' +
254-
'https://create-react-app.dev/docs/getting-started/',
255-
);
256-
console.log();
257-
} else {
258-
const useYarn = isUsingYarn();
259-
createApp(
260-
projectName,
261-
program.verbose,
262-
program.scriptsVersion,
263-
program.template,
264-
useYarn,
265-
program.usePnp,
266-
);
267-
}
268-
});
231+
232+
// Commented out to disable version check
233+
// checkForLatestVersion()
234+
// .catch(() => {
235+
// try {
236+
// return execSync('npm view create-react-app version').toString().trim();
237+
// } catch (e) {
238+
// return null;
239+
// }
240+
// })
241+
// .then((latest) => {
242+
// if (latest && semver.lt(packageJson.version, latest)) {
243+
// console.log();
244+
// console.error(
245+
// chalk.yellow(
246+
// `You are running \`create-react-app\` ${packageJson.version}, which is behind the latest release (${latest}).\n\n` +
247+
// 'We recommend always using the latest version of create-react-app if possible.',
248+
// ),
249+
// );
250+
// console.log();
251+
// console.log(
252+
// 'The latest instructions for creating a new app can be found here:\n' +
253+
// 'https://create-react-app.dev/docs/getting-started/',
254+
// );
255+
// console.log();
256+
// } else {
257+
const useYarn = isUsingYarn();
258+
createApp(
259+
projectName,
260+
program.verbose,
261+
program.scriptsVersion,
262+
program.template,
263+
useYarn,
264+
program.usePnp,
265+
);
266+
// }
267+
// });
269268
}
270269

271270
function createApp(name, verbose, version, template, useYarn, usePnp) {

0 commit comments

Comments
 (0)