From 22f69457e9343b2a2249b57bf02e49a670ec0eb8 Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Sun, 5 Mar 2017 17:11:09 +0000 Subject: [PATCH] Tweak failure message --- packages/create-react-app/index.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/create-react-app/index.js b/packages/create-react-app/index.js index c4e54a90615..6e14cf7abbd 100755 --- a/packages/create-react-app/index.js +++ b/packages/create-react-app/index.js @@ -353,9 +353,10 @@ function getPackageName(installPackage) { }).catch(function(err) { // The package name could be with or without semver version, e.g. react-scripts-0.2.0-alpha.1.tgz // However, this function returns package name only without semver version. - console.log('Failed to extract package: ' + err.message); - console.log('Falling back to naive behavior ...') - return Promise.resolve(installPackage.match(/^.+\/(.+?)(?:-\d+.+)?\.tgz$/)[1]); + console.log('Could not extract the package name from the archive: ' + err.message); + var assumedProjectName = installPackage.match(/^.+\/(.+?)(?:-\d+.+)?\.tgz$/)[1]; + console.log('Based on the filename, assuming it is "' + chalk.cyan(assumedProjectName) + '"'); + return Promise.resolve(assumedProjectName); }); } else if (installPackage.indexOf('git+') === 0) { // Pull package name out of git urls e.g: