Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Meta
create-react-app
Commits
061aa2cd
Commit
061aa2cd
authored
8 years ago
by
Dan Abramov
Browse files
Options
Download
Email Patches
Plain Diff
Tweak app name error message
parent
3a42ff90
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
global-cli/index.js
+11
-8
global-cli/index.js
with
11 additions
and
8 deletions
+11
-8
global-cli/index.js
+
11
-
8
View file @
061aa2cd
...
@@ -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\n
Please choose a different project name.
'
)
);
);
process
.
exit
(
1
);
process
.
exit
(
1
);
}
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment