npm install react js code example

Example 1: npm install react

npm i react

Example 2: install react js

npx create-react-app <appname>  //  eg:  npx create-react-app blog
cd <appname>  // cd blog
npm start  //runs on localhost:3000

Example 3: npm start react

npx create-react-app mon-app
cd mon-app
npm start

Example 4: create a new project with create-react-app

npx create-react-app project-name

Example 5: reactjs install

npm install -g create-react-app -> install create react app tools
create-react-app app01 -> create your first projects app001