Environment Setup and Installation for React Js Application
- Get link
- X
- Other Apps
Environment Setup and Installation for React Js Application
In this post, you will learn about “how to set up an environment for React Application”.
There are many steps involved, in which first and important step is to install Node Js and npm.
Install Node Js
- Node Js is an open-source, cross-platform, back-end JavaScript runtime environment that runs on the V8 engine.
- After invention of Node Js, we are able to execute JavaScript code outside a web browser.
- NPM will be installed along with Node Js.
- Node Js can be downloaded and installed from official Node Js website:
- After successful installation of Node Js, Open Command Prompt in order to check its version as shown in below.
Install Create-React-App
- Second step is to install a tool called Create-React-App using NPM which will be useful for creating react application easily from our system.
- You can install this at the system level or global level.
- We will install it globally by using following command.
npm install –g create-react-app
Create a new react project
- After successful installation of Create-React-App, now we can create our first react application. Let’s create our project or application in D:\TestApp, so we need to point our command prompt to this folder by using the CD command.
create-react-app test-react-project
Create a package.json file
- Package.json file is very important for creating any module, so to generate package.json file, we have to run following command on path (D:\TestApp\test-react-project) from the command prompt.
npm init
Run the react application
- Run following command locally in our system (D:\TestApp\test-react-project).
npm start
- Now, Launch the browser and visit http://localhost:3000 as shown in below.
Editor IDE:
If you want to build react application on your system, I will recommend following text editor for you.
- Visual Studio Code
- Sublime Text
- WebStorm
- Atom
Online editor:
If you want to build react application without taking the pain to setup your system then following online code editors are best options for you.
Happy Learning!! Happy Coding!!
- Get link
- X
- Other Apps
Comments
New comments are not allowed.
Good post about React environment setup
ReplyDelete