So you started learning React and you are wondering how to run your React app locally. Well, you have come to the right place!
If you are starting your project new, read the guide below. However, if you have your files and want to edit or continue working on them locally(watch out for my next article on how to do so)
What you will need:
Visual Studio Code(VS Code)(if you don't have it installed you can download it here
Node.js and NPM installed (if yet to install click on the download node.js to install). Here is a Tutorial if you need one.
Step 1 - Opening VS Code and Root folder
Launch VS Code on your local machine.
Open and add the root folder (This is the folder you want to save your projects in) to your workspace on Vscode.
Step 2 - Open a new terminal
Go to the terminal on the top menu and click New terminal or ctrl+shift+'.
Choose the folder you want your react app to be created in if you have many folders added to your workspace and the terminal will be opened! Check the image above for reference.
Step 3 - Creating the folder
Type the below command into the terminal to create a react folder with boiler-plate code. Travel-journal is the name of your folder and should in small letters only!
npx create-react-app travel-journal
This shows your new react app is being created!
This shows your new react app is ready to be launched! Notice the new folder with the name of your app? Yes! that means it worked!
Step 4- Open and run the local server
To confirm it has worked, Open and run the local server by typing the below code!
cd my-appnpm start
This is the confirmation that it has worked!
Step 5 - Congratulations on launching your first React app locally
This marks the end of the tutorial. If you have any questions or feedback, please leave a comment below. Happy Coding!