Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how i can run react program in vs code #13633

Open
SeHrBiz opened this issue Jul 15, 2024 · 6 comments
Open

how i can run react program in vs code #13633

SeHrBiz opened this issue Jul 15, 2024 · 6 comments

Comments

@SeHrBiz
Copy link

SeHrBiz commented Jul 15, 2024

No description provided.

@arashghezavati
Copy link

To run a React program in VS Code, first install Node.js from nodejs.org. Open VS Code, create a new React app using npx create-react-app my-app in the terminal, then navigate to the app folder with cd my-app. Install dependencies with npm install and start the app using npm start in the terminal.

@bharat407
Copy link

CMD in vs code terminal :-
npm run start

@harish00506
Copy link

follow these steps to run react program in vscode
install node from internet
go to vs code
open terminal
type npx create-react-app my-app
cd my-app
npm start

your react app is running

@jatintyagi1
Copy link

  1. install node js and npm
  2. install vs code from browser
  3. open terminal and type command { npx create-react-app my app }
  4. cd my app
  5. npm start

now your app is running on browser

@Xhz0729
Copy link

Xhz0729 commented Aug 29, 2024

To run a React program in Visual Studio Code (VS Code), follow these steps:

  1. Set Up Your React Project

If you haven't already created a React project, you can use create-react-app to set it up:

npx create-react-app my-react-app

This will create a new React project in a directory called my-react-app.

  1. Open the Project in VS Code

  2. Open VS Code.

  3. Click on File > Open Folder... and navigate to your React project directory (e.g., my-react-app).

  4. Select the folder to open it in VS Code.

  5. Install Dependencies

If you cloned an existing React project or downloaded one, you need to install the necessary dependencies:

  1. Open a terminal in VS Code by going to View > Terminal.

  2. Make sure you're in the root directory of your React project.

  3. Run the following command to install dependencies:

    npm install
  4. Run the React Application

To start the React development server:

  1. In the terminal, make sure you're in the root directory of your React project.

  2. Run the following command:

    npm start

This command will start the development server, and you should see output in the terminal showing that the server is running.

@wandanamaddumage
Copy link

1. Install Node.js and npm

  • Download and install Node.js (which includes npm).
  • To check if they're installed correctly, run the following commands in your terminal:
    node -v npm -v

2. Set Up a React Project

  • Open a terminal in VS Code (Ctrl + ~) and navigate to the folder where you want to create your React project.
  • Run the following command to create a new React app using create-react-app (a simple way to set up a React environment):
    npx create-react-app my-app
  • Replace my-app with the desired name of your project.

3. Open the Project in VS Code

  • Once the project is created, navigate into the project folder:
    cd my-app
  • Then open the folder in VS Code:
    code .

4. Start the Development Server

  • In the terminal, run:
    npm start
  • This will start the development server, and your React app will be accessible at http://localhost:3000 in your browser.

5. Make Changes and See Live Updates

  • As you modify the code in VS Code, the browser will automatically reload and reflect the changes.
    This setup lets you develop and run React applications directly in VS Code!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants