Tuesday, January 25, 2022

Use javascript scaffolding to quickly build a React project

 


Use javascript scaffolding to quickly build a React project




1. Project construction

create-react-app is a framework officially launched by Facebook that can basically create a webpack-based React development environment with zero configuration.
Steps:
Open the console
Enter the directory file where you want to create the project.

Run the following commands in sequence

  1. npm install -g create-response-app
  2. create-response-app my-demo
  3. npm start

Once done, you can quickly create a React development environment.
You can view the project at http://localhost:3000/

2. Problems encountered

After executing npm install -g create-response-app the following error occurred:


Solution: Just replace npm with cnpm, but cnpm has the following error:


The above permission denied issue has been resolved. This is because there is no permission, so add sudo in front of it like below: (Author's protest is valid 😯), after doing the following steps it's very smooth hahahaha😁 .


 

Generators and scaffolds (scaffolds and generators)

  Generators and scaffolds (scaffolds and generators) GENERATOR A generator is a program (script) that writes programs (or code fragments) a...