A Step-by-Step Guide to Running a React JS App in Visual Studio Code | Installing and Setting up React in VS Code 2023

Posted by






How to run React JS app in Visual studio code tutorial

How to run React JS app in Visual studio code tutorial

In this tutorial, we will learn how to run a React JS app in Visual Studio Code. Visual Studio Code is a popular text editor among web developers and it provides great support for building and running React applications. We will also cover the steps to download and install React in VS Code.

Download and install React in VS Code

The first step is to download and install Node.js, which includes npm (Node Package Manager). You can download Node.js from the official website and follow the installation instructions. Once Node.js is installed, you can use npm to install create-react-app, which is a tool that allows you to create a new React app with just one line of code.

To install create-react-app, open a terminal or command prompt and run the following command:

npm install -g create-react-app

This will install create-react-app globally on your system, allowing you to use it from any directory. Once create-react-app is installed, you can create a new React app by running the following command:

npx create-react-app my-React-app

Replace ‘my-React-app’ with the name you want for your app. This will create a new directory with all the files and dependencies you need for your React app.

Run React app in Visual Studio Code

Now that you have a React app created, you can open it in Visual Studio Code. Open Visual Studio Code and go to File -> Open Folder, then select the folder where your React app is located.

Once the folder is open in Visual Studio Code, open a new terminal by going to Terminal -> New Terminal. In the terminal, navigate to the directory of your React app and run the following command to start the app:

npm start

This will start a development server for your React app and open it in your default web browser. You can now make changes to your app and see them reflected in real-time in the browser.

That’s it! You have now successfully downloaded, installed, and run a React app in Visual Studio Code. Happy coding!


0 0 votes
Article Rating
20 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
United Top Tech
7 months ago

Check description for the commands used

Alya Rany
7 months ago

npx : The term 'npx' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was

included, verify that the path is correct and try again.

At line:1 char:1

+ npx create-react-app my-app

+ ~~~

+ CategoryInfo : ObjectNotFound: (npx:String) [], CommandNotFoundException

+ FullyQualifiedErrorId : CommandNotFoundException
@unitedtoptech6288

Ismahan Imran
7 months ago

why do you need a node js when we're talking about react?

Amisha Mallick
7 months ago

I installed the extension but when I run a react program it just show code language not supported or defined.. Is there any solution for it

Miielli
7 months ago

Thank you very much man, you literaly saved my school project.

Keshav Shukla
7 months ago

sir im getting npm error

Sudeep Karki
7 months ago

PS C:UsersHPDesktopultimate-react-course-main> npx create-react-app@5 pizza-menu

npm ERR! code ENOENT

npm ERR! syscall lstat

npm ERR! path C:UsersHPAppDataRoamingnpm

npm ERR! errno -4058

npm ERR! enoent ENOENT: no such file or directory, lstat 'C:UsersHPAppDataRoamingnpm'

npm ERR! enoent This is related to npm not being able to find a file.

npm ERR! enoent

i'm getting this error how to solve it ?

janidu yapa
7 months ago

thanks bro

Priyanka Srivastava
7 months ago

Thank you sir♥️

Zaid Khan
7 months ago

very usefull

Prabod Jayaneth
7 months ago

adhisneha Reddy
7 months ago

npm WARN deprecated tar@2.2.2: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.

changed 67 packages in 3s

5 packages are looking for funding

run `npm fund` for details

PS C:UsersDellOneDriveDesktopreact project>

i am facing this while running the command, how to solve?

eLiza
7 months ago

Great video. Very easy to follow the steps. 👌👌

Raghav upadhyay
7 months ago

it saying "npx not recognised"

Risav Kumar Jha
7 months ago

Thanks for Sharing:)

Azrexg
7 months ago

best , helped a lot trying to this for 3 hours 😭😭😭

Valentin G
7 months ago

Very good job! Loved the tutorial

svvd
7 months ago

thankyou man

Ngumi Perry
7 months ago

7:52 im getting some errors 😢

Yamuna Naramsetti
7 months ago

When im trying to create new react app, i got this type of error , what will i do?

npm ERR! code ENOENT

npm ERR! syscall lstat

npm ERR! path C:UsersjagadAppDataRoamingnpm

npm ERR! errno -4058

npm ERR! enoent ENOENT: no such file or directory, lstat 'C:UsersjagadAppDataRoamingnpm'

npm ERR! enoent This is related to npm not being able to find a file.

npm ERR! enoent

npm ERR! A complete log of this run can be found in: C:UsersjagadAppDataLocalnpm-cache_logs2023-09-21T06_06_20_921Z-debug-0.log