Commit 061aa2cd authored by Dan Abramov's avatar Dan Abramov
Browse files

Tweak app name error message

parent 3a42ff90
Showing with 11 additions and 8 deletions
+11 -8
...@@ -29,6 +29,9 @@ ...@@ -29,6 +29,9 @@
// Do not make breaking changes! We absolutely don't want to have to // Do not make breaking changes! We absolutely don't want to have to
// tell people to update their global version of create-react-app. // 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 /!\ // /!\ DO NOT MODIFY THIS FILE /!\
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
...@@ -190,15 +193,15 @@ function checkAppName(appName) { ...@@ -190,15 +193,15 @@ function checkAppName(appName) {
if (allDependencies.indexOf(appName) >= 0) { if (allDependencies.indexOf(appName) >= 0) {
console.error( console.error(
chalk.red( chalk.red(
`Can't use "${appName}" as the app name because a dependency with the same name exists.\n\n` + 'We cannot create a project called `' + appName + '` because a dependency with the same name exists.\n' +
`Following names ${chalk.red.bold('must not')} be used:\n\n` 'Due to the way npm works, the following names are not allowed:\n\n'
) ) +
+
chalk.cyan( 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); process.exit(1);
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment