Setting up the React environment
In order to run React, we need to set up an initial environment, which includes installing a couple of libraries of node.js
.
Installing node
Before we start installing React and the package list, we need to have node.js
installed on our system.
In Linux (Debian-based system), the process of installation is pretty simple.
First, we need to add PPA from the node.js
official website by using the following commands:
$ sudo apt-get install python-software-properties$ curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash -
Once it is set up, we can install node.js
with the following command:
$ apt-get install nodejs
Now let's check the node
and npm
versions, as follows:
$ npm -v 4.1.2 $ node -vV7.7.4
In our setup, we use the aforementioned version, but the node version around v7.x should be fine, and for npm, v4.x should work fine.
Creating package.json
This file is, basically, metadata for your application, which contains the complete libraries /dependencies that...