React environment construction
1. The node environment is deployed
Enter in the terminal node -v
to display the node version number; for example: v10.14.1
enter in the terminal npm-v
to display the npm version number; for example:6.6.0
2. Build a simple react single page application
Create a new folder on the desktop; such as: react-learn
;;
Open the folder in the terminal;
enter the file directory in the terminal: npx create-react-app my-app
;
After loading, enter: cd my-app
;
Enter my-app
the directory;
then run npm start
;
Note: npx is npm 5.2+ The attached package running tool. Requires environment version Node >= 8.10 and npm >= 5.6.
You can see the following effect in the terminal:
Then open it with a browserhttp://localhost:3000