Deke
Deke

Reputation: 4659

How to rename the folder created by create react app?

create-react-app foldernameA

I want to change the folder name to foldernameB. What is the command?

Upvotes: 9

Views: 20673

Answers (4)

Sridhar Rajaram
Sridhar Rajaram

Reputation: 91

Follow the below 4 steps for renaming the projectname created using "npx create-react-app projectname"

  1. goto that projectfolder and right click and rename as per your wish. and also copy that text what to typed.
  2. go inside that project folder, you will find package.json and package-lock.json
  3. open both files in VSC, change value of "name" to the "newly changed text" and save close.
  4. in VSC, cd "projectname" and then npm start.
  5. it will be deployed in browser

Upvotes: 9

Ashim Khan
Ashim Khan

Reputation: 11

If you are ran into some trouble due to the name of your application and want to change it, you will also have change the name in the 'package.json' file. I had the app name and later tried to install the dependency which coincidentally had the same name, so even after changing the name of the folder i kept getting name conflicty from npm. So had to change the name inside the package file as well.

Upvotes: 0

Veera Sudhan
Veera Sudhan

Reputation: 39

You can rename the absolute folder from desktop rather than on the editor or IDE.

Upvotes: 0

grizzthedj
grizzthedj

Reputation: 7505

As @Tholle mentioned, you can simply rename the folder using the mv command.

mv foldernameA foldernameB

Alternatively, you can just create a new project with the desired name, and copy files there.

create-react-app foldernameB

Upvotes: 7

Related Questions