React from A-Z — Part A — Install/Update Node JS

Nipuna Upeksha
3 min readJan 2, 2021

What is React?

React is an open-source, front-end, JavaScript library for building user interfaces or UI components. It is maintained by Facebook and a community of individual developers and companies.

One of the major problems that a newbie to “React” would always get is not understanding the JSX. So what is JSX? JSX stands for JavaScript XML which allows you to write HTML in React. To be honest, the meaning of JSX is not useful, because what you need to understand is how to make a website using JSX.

So, without further ado, let’s jump into programming using “React”. But to do this we have to follow a few steps.

Steps to create your first React project

Install/Update Node JS

One of the main things I would like to tell you now is I am using Windows and I will only tell you how to set up the environment in Windows. It is similar in Linux and Mac-OS, but some terms and approaches may differ.

First, open the Windows terminal and type node -v to check whether you have already installed the Node JS or not. If it shows something similar to the following image, you don’t have to install Node JS. You only have to update it.

node -v to check whether the Node JS is installed or not

Another thing you want to confirm is whether you already have “npm” or “node package manager” or not. To check that type npm -v in the command prompt. If it shows something like the following image you only have to update it.

npm -v to check whether the npm is installed or not

But if either one is missing, just remove the installed one using “add or remove programs” in the control panel and follow the steps given below.

First, go to https://nodejs.org/en/download/ and download the Node JS installer according to your platform.

Download Node JS from nodejs.org

Then, double click the downloaded file and install it. During the installation, it will ask you to add the path to your environment, confirm to add it to your environment variables. If you missed that step, don’t worry. Just follow the following steps.

First type “environment variables” in the Windows search bar.

Setting up environment variables

Then select the “environment variables” and go to “path” in “System variables”. Then you can browse the place where you have installed the Node JS and add it to the path.

Setting up environment variables

To check whether you are good to go, just type node -v and npm -v in command prompt and confirm it.

To update the Node JS and npm,

First, clear the npm cache by typing npm cache clean -f Then, install n module globally by typing npm install -g n After that, you can type n stable to install the latest stable version, or n latest to install the latest version or n [version.number] to install the preferred version of Node JS.

To update npm you can just type npm install -g npm But this will remove all the npm packages you have installed separately. So, the better option is, npm update -g

After updating Node JS and npm, check whether they are working by typing node -v and npm -v

In the next article, I will tell you what Yarn is and how to install/ update Yarn.

--

--