Creating a new app in the current directory
See original GitHub issue$ mkdir app
$ cd app
$ git init .
$ create-react-app .
> The directory `.` already exists. Aborting.
It would be nice if this worked
Issue Analytics
- State:
- Created 7 years ago
- Reactions:6
- Comments:20 (13 by maintainers)
Top Results From Across the Web
How to create a React app directly in the current folder
First go to the directory where you want to create react app. · Then run the command npx create-react-app .
Read more >Create a React app in the current directory | bobbyhadz
Use a dot for the path to create a React app in the current directory, e.g. npx create-react-app . or npx create-react-app ....
Read more >Create a React app in the current folder - so no new folder
Use Create -React- App to get a React app in same folder. Professional JavaScript Course: ...
Read more >How to Create a Next.js App in the Current Directory
You can initialize a new Next.js app in the current directory by using a dot (.) for the path when running the npx...
Read more >Creating a new rails app in the current directory - Content Posts
and this will create a folder within the current working directory with the name new_app where all the required files and folders will...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Currently the behavior is that you can only run
create-react-app
in a nonexistent directory. It doesn’t let you run in an already-existing directory because you don’t want to accidentally splat these files into somewhere like~
.But, if we let you run
create-react-app
in an empty directory, I think that would be ok. I think it would also be OK if there was a readme / readme.md and dotfiles like .gitignore in the directory. That makes things work with a workflow where you first create a new repo on github, you clone it to your local machine, and then you runcreate-react-app
. It’s hard for me to imagine a case where that causes you much pain.If we’re in the game of guessing things that would not conflict, I would only check if there’s a package.json file. If that’s the case, then it’s probably unsafe, otherwise should be good to go.