
Or, you can install all of them in single command as −Ĭ:\Users\username\Desktop\reactApp>npm install react react-dom -save You can add the packages we install, to package.json file using the -save option.Ĭ:\Users\Tutorialspoint\Desktop\reactApp>npm install react -saveĬ:\Users\Tutorialspoint\Desktop\reactApp>npm install react-dom -save Since our main task is to install ReactJS, install it, and its dom packages, using install react and react-dom commands of npm respectively. "test": "echo \"Error: no test specified\" & exit 1" you can skip these using the –y option.Ĭ:\Users\username\Desktop\reactApp>npm init -y This command asks information about the module such as packagename, description, author etc. To do so you need to run the npm init command from the command prompt.Ĭ:\Users\username\Desktop\reactApp>npm init Therefore, after Creating the folder, we need to create a package.json file.

To create any module, it is required to generate the package.json file. Step 1 - Create the Root FolderĬreate a folder with name reactApp on the desktop to install all the required files, using the mkdir command. Using this you will be able to use the new ES6 features in your code where, babel converts it into plain old ES5 which can be run on all browsers. It is used to convert one source code to other. You can use this bundle while developing apps using command line or, by configuring it using nfig file.īabel is a JavaScript compiler and transpiler. It takes dependent modules and compiles them to a single (file) bundle.


Webpack is a module bundler (manages and loads independent modules). Installing ReactJS using webpack and babel

Checkout our NodeJS Environment Setup.Īfter successfully installing NodeJS, we can start installing React upon it using npm. NodeJS is the platform needed for the ReactJS development. We will need NodeJS, so if you don't have it installed, check the link from the following table. Notice that there are many steps involved but this will help speed up the development process later. In this chapter, we will show you how to set up an environment for successful React development.
