D Dev Notebook

React Environment Setup

Environment Setup for React

Install Node.js and npm

Node.js is an open-source, cross-platform JavaScript runtime environment that executes JavaScript code outside of a web browser.

NPM stands for Node Package Manager and is the default package manager for the Node.js runtime environment.

Download Node.js:

Go to https://nodejs.org and download the LTS version.

Verify installation

Open a terminal and type

node -v 
npm -v 

Create First Project

Install and create a project:

npx create-react-app project1 
cd project1 
npm start  

open browser at http://localhost:3000

*npx create-react-app project1

The command initializes a new React application named "project1". It leverages npx, the Node Package eXecutor, to download and execute the create-react-app package, a tool designed to set up a basic React project structure with all necessary configurations and dependencies.

*npm start:

Starts the development server, enabling hot reloading for real-time updates in the browser as code changes.

Code Editor

Visual Studio Code

Brackets

Cursor AI

Atom

Extension for Visual Studio Code

ESLint

Prettier - code formatter

React Developer Tool (browser extension)

React Snippets

On this page