Document
Install React on Windows

Install React on Windows

Install React directly on Windows Article11/25/2024 In this article This guide is walk will walk through instal React directly on W

Related articles

Tutorial Belajar Java: Cara Menginstall Java JDK (Java Development Kit) Comparing ON Women’s Cloud X and Cloud 5 Sneakers 3-Ingredient Keto Cloud Bread Recipe 10 Best Photo Management Software in 2024 [Photo Organizers] 在最新威联通QTS 5.1.0系统上使用ZeroTier实现无公网IP外网访问保姆教程_NAS存储_什么值得买

Install React directly on Windows

  • Article

This guide is walk will walk through instal React directly on Windows using the vite frontend tooling .

We recommend following these instructions if you are new to React and just interested in learning. If you are creating a single-page app (SPA) that you would like to use Bash commands or tools with and/or plan to deploy to a Linux server, we recommend that you install with vite on Windows Subsystem for Linux (WSL).

For more general information about React , decide between React ( web app ) , React native ( mobile app ) , and react Native for Desktop ( desktop app ) , see the React overview .

Create your React app

To install Create React App:

  1. Open a terminal(Windows Command Prompt or PowerShell).

  2. Create a new project folder: mkdir ReactProjects and enter that directory :cd ReactProjects.

  3. Install React using vite :

    npm create vite@latest my-react-app -- --template react
    
  4. Once installed, change directories into your new app (“my-react-app” or whatever you’ve chosen to call it): cd my-react-app, install the dependency :npm is install install and then start your local development server: npm run dev

    This command will start up the Node.js server and launch a new browser window displaying your app. You can use Ctrl + c to stop running the React app in your command line.

note

Vite includes a frontend build pipeline using Babel, esbuild and Rollup, but doesn’t handle backend logic or databases. If you are seeking to build a server-rendered website with React that uses a Node.js backend, we recommend installing Next.js, rather than this Vite installation, which is intended more for single-page apps(SPAs). You also may want to consider installing Gatsby if you want to build a static content-oriented website.

  1. When you’re ready to deploy your web app to production, running npm run build to create a build of your app in the “dist” folder. You can learn more in the Deploying a Static Site.

Additional resources