Skip to content

Commit 22f6945

Browse files
committed
Tweak failure message
1 parent 5d64ee4 commit 22f6945

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

packages/create-react-app/index.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -353,9 +353,10 @@ function getPackageName(installPackage) {
353353
}).catch(function(err) {
354354
// The package name could be with or without semver version, e.g. react-scripts-0.2.0-alpha.1.tgz
355355
// However, this function returns package name only without semver version.
356-
console.log('Failed to extract package: ' + err.message);
357-
console.log('Falling back to naive behavior ...')
358-
return Promise.resolve(installPackage.match(/^.+\/(.+?)(?:-\d+.+)?\.tgz$/)[1]);
356+
console.log('Could not extract the package name from the archive: ' + err.message);
357+
var assumedProjectName = installPackage.match(/^.+\/(.+?)(?:-\d+.+)?\.tgz$/)[1];
358+
console.log('Based on the filename, assuming it is "' + chalk.cyan(assumedProjectName) + '"');
359+
return Promise.resolve(assumedProjectName);
359360
});
360361
} else if (installPackage.indexOf('git+') === 0) {
361362
// Pull package name out of git urls e.g:

0 commit comments

Comments
 (0)