Create React App Using npx
Here we are discussing creating react app using npx create-react-app. npx comes with npm 5.2 and higher.
Prerequisite: You need to install Node >= 8.10 on your machine.
Creating an app using npx command
npx create-react-app my-app
create-react-app set up the main structure of the application.
Important: If you previously installed create-react-app using npm, uninstall before using npx. Because npx always refer the latest version of libraries.
Open the project folder you can see the file structure as follows.
♦. node_modules – This directory contains dependencies and sub-dependencies of packages used by the application.
♦. package.json – file outlines all the settings for the React application.
♦.public – This directory contains assets that will be served directly
♦.src– This directory contains all user defined react components and component-related files and views.
To start the project run command,
project run on http://localhost:3000/