premise
1. You need to install node.js in advance
2. You need to compile the software (I use VScode here), you can download it yourself
3. React Chinese official website https://react.docschina.org/tutorial/tutorial.html#setup-option -2-local-development-environment
My current node version (for reference only)
initialization
build development environment
Open cmd and run it as an administrator (forgot to take a screenshot, the installation is successful)
npm install -g create-react-app
first initial project
-
Open cmd under the folder where the project is stored, create a project, and my-react-app is the name of the project. If you
create-react-app my-react-app
see the content in the following screenshot, it is successful.
-
Enter the project root directory
cd my-react-app
-
run
npm start
-
At this time, use a browser to access - http://localhost:3000/ to view the following page, indicating that the initialization is successful
↑ 2.17 update