Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create a React app directly in the current folder

I know I've done it before but I can't seem to find the answer anywhere. I want to run create-react-app without creating a whole other folder within the folder I'm already in. I believe it is just an additional flag appended to the command.

like image 307
Niko Roberts Avatar asked Oct 06 '22 12:10

Niko Roberts


People also ask

How do I create a react app in the current directory?

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 . --template typescript for TypeScript projects. Make sure your folder name doesn't contain special characters, spaces or capital letters.

How do I deploy an existing reacting app?

For your React app, you'll have to drag and drop the build folder onto the Netlify Dashboard. Run npm run build beforehand to deploy the latest build. You can also connect GitHub, GitLab, or Bitbucket, depending on where your project is stored. This allows automatic deployment whenever you push your changes.


2 Answers

You can create a new React app in the current directory by writing . instead of a project name.

create-react-app .
like image 360
Tholle Avatar answered Oct 09 '22 00:10

Tholle


If you've previously installed create-react-app globally via npm install -g create-react-app, we recommend you uninstall the package using npm uninstall -g create-react-app to ensure that npx always uses the latest version.

For a new version of create-react-app (v3):

npx create-react-app .

Please pay attention to a full stop(dot) at the end of your command . which corresponds to a current directory

like image 94
Bakhtiiar Muzakparov Avatar answered Oct 09 '22 02:10

Bakhtiiar Muzakparov