Skip to content

Commit

Permalink
Tweak app name error message
Browse files Browse the repository at this point in the history
  • Loading branch information
gaearon committed Sep 18, 2016
1 parent 3a42ff9 commit 061aa2c
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions global-cli/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
// Do not make breaking changes! We absolutely don't want to have to
// tell people to update their global version of create-react-app.
//
// Also be careful with new language features.
// This file must work on Node 0.10+.
//
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// /!\ DO NOT MODIFY THIS FILE /!\
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -190,15 +193,15 @@ function checkAppName(appName) {
if (allDependencies.indexOf(appName) >= 0) {
console.error(
chalk.red(
`Can't use "${appName}" as the app name because a dependency with the same name exists.\n\n` +
`Following names ${chalk.red.bold('must not')} be used:\n\n`
)

+

'We cannot create a project called `' + appName + '` because a dependency with the same name exists.\n' +
'Due to the way npm works, the following names are not allowed:\n\n'
) +
chalk.cyan(
allDependencies.map(depName => ` ${depName}`).join('\n')
)
allDependencies.map(function(depName) {
return ' ' + depName;
}).join('\n')
) +
chalk.red('\n\nPlease choose a different project name.')
);
process.exit(1);
}
Expand Down

0 comments on commit 061aa2c

Please sign in to comment.