question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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:closed
  • Created 7 years ago
  • Reactions:6
  • Comments:20 (13 by maintainers)

github_iconTop GitHub Comments

5reactions
lackercommented, Aug 2, 2016

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 run create-react-app. It’s hard for me to imagine a case where that causes you much pain.

2reactions
vjeuxcommented, Aug 3, 2016

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found