9

create-react-app foldernameA

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

3
  • Can't you just make another project and move your files there? Commented Aug 3, 2018 at 15:17
  • create-react-app appears to be a library on github, not a reversible command. Assuming it's an ordinary folder, you change the name of it the same way you would any other folder. But that could break something. It might be easier just to create a new project. Commented Aug 3, 2018 at 15:18
  • 2
    mv foldernameA foldernameB Commented Aug 3, 2018 at 15:18

4 Answers 4

9

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
Sign up to request clarification or add additional context in comments.

Comments

7

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

Comments

0

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

Comments

0

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.