You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
create-react-app allows you to create an app with spaces (and uppercase letters). Simply fire create-react-app "Example project" and it will be created! This, however, creates some issues stated below.
Expected behavior
create-react-app should disallow creating apps with spaces and uppercase letters
OR
create-react-app should detect if there are spaces/uppercase letters in project name provided by the user and:
Success message after creating an app should wrap project name in quotes if necessary
Project name in package.json should have spaces changed to dashes to avoid npm error
Actual behavior
After the app is created using the command above, a help message is displayed suggesting to go to the folder created by create-react app (sorry, don't remember it word-by word):
> App created successfully (...)
> Run the following command:
> cd **{project_name_here}**
Obviously, running command like cd ./My project won't work (we need to use command like cd "./My project").
Furthermore, running the app fails as the name containing spaces is also inserted into package.json file, and npm throws an error.
The text was updated successfully, but these errors were encountered:
Nice catch! We would greatly appreciate if you could pull together a PR fixing this.
I believe I like the section option more, automatically replacing spaces with dashes and lowercasing.
Its kinda tricky to provide a generic escaping mechanism because the project name has some requirements to be met. Maybe a simple validation step based on https://github.com/npm/validate-npm-package-name during creation is sufficient enough.
Description
create-react-app allows you to create an app with spaces (and uppercase letters). Simply fire
create-react-app "Example project"
and it will be created! This, however, creates some issues stated below.Expected behavior
OR
Actual behavior
After the app is created using the command above, a help message is displayed suggesting to go to the folder created by create-react app (sorry, don't remember it word-by word):
Obviously, running command like
cd ./My project
won't work (we need to use command likecd "./My project"
).Furthermore, running the app fails as the name containing spaces is also inserted into package.json file, and npm throws an error.
The text was updated successfully, but these errors were encountered: