Skip to content

Commit 061aa2c

Browse files
committed
Tweak app name error message
1 parent 3a42ff9 commit 061aa2c

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

global-cli/index.js

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@
2929
// Do not make breaking changes! We absolutely don't want to have to
3030
// tell people to update their global version of create-react-app.
3131
//
32+
// Also be careful with new language features.
33+
// This file must work on Node 0.10+.
34+
//
3235
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3336
// /!\ DO NOT MODIFY THIS FILE /!\
3437
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -190,15 +193,15 @@ function checkAppName(appName) {
190193
if (allDependencies.indexOf(appName) >= 0) {
191194
console.error(
192195
chalk.red(
193-
`Can't use "${appName}" as the app name because a dependency with the same name exists.\n\n` +
194-
`Following names ${chalk.red.bold('must not')} be used:\n\n`
195-
)
196-
197-
+
198-
196+
'We cannot create a project called `' + appName + '` because a dependency with the same name exists.\n' +
197+
'Due to the way npm works, the following names are not allowed:\n\n'
198+
) +
199199
chalk.cyan(
200-
allDependencies.map(depName => ` ${depName}`).join('\n')
201-
)
200+
allDependencies.map(function(depName) {
201+
return ' ' + depName;
202+
}).join('\n')
203+
) +
204+
chalk.red('\n\nPlease choose a different project name.')
202205
);
203206
process.exit(1);
204207
}

0 commit comments

Comments
 (0)