This helps in guiding in assuming that can help in using macOS. Before you can start, you can help in coming along with a user account with the help of the installation privileges and thus help in getting unrestricted access, which helps in citing the websites in this document.
This document is often referred to with the help in getting anyone who can help in gaining to installing the latest nodejs on your productive mac.
4 GB RAM
10 GB free space
To install the react tooling we need nodejs and npm. So first let’s understand these are and why we need them.
What is Nodejs, and why do you require to react development?
It would help if you had the nodejs for dev tooling (like local webserver with live reloading features) and dev experience, which can help you require nodejs to run react in production.
What is npm and why do you need to react development?
It helps in giving the tools that further help in installing and then libraries and then can help in giving along with other tools that help in supporting the react development.
Let us start with the nodejs installation post-completion over nodejs that can help in installing to create a-react-app command line that can further allow creating a new react project.
Download nodejs – Visit nodejs download page here. Click on the system like macOS Installer to download the latest version of node installable package.
Install nodejs – You can help by clicking on the download node-vxx.xx.xx.pkg ( for example node-v10.15.0.pkg) in the previous step to start the installation, shown below the screen. Please click continue
With the help of clicking and then continuing over the earlier step, you in asking to accept a license, and you need to please click continue.
Please accept the agreement by clicking Agree
Click install, which would prompt you for the credentials
Provide username and password and click Install Software
The successful installation can help give the screen that shows the installation’s summary.
To access the node and npm executable from the terminal make sure /usr/local/bin is in your $PATH. You can verify that by running the echo $PATH command in the terminal.
You can use also a terminal and run the below command to test the node
You should also get to see the output like below (Note: Your version may vary depending on your date of installing as the nodejs team make an aggressive release but make sure your node version is > v10.0.0)
You can help in opening the terminal and run the below command to test npm
You should see an output like below (Note: Your version may vary depending on your date of installing as nodejs team make an aggressive release but make sure your npm version is
Install create react app
Establishing the productive react development environment can help in adding the configuration tools like babel, web pack which are difficult to configure for a newbie in react world.
Several tools can help reduce this problem out of which create react app is the easiest and finest tool that comes up with the pre-built production-grade configurations. Moreover, the benefits you gain in the tool help in allowing you to help in altering the configuration by ejecting the create react app.
We will install create-react-app using npm. Then, on the terminal, run the install command shown below.
npm install -g create-react-app
npm install -g
On any successful installation, one can help in giving along with the output like above (note your create-react-app version may be different by the time you run this install command)
To test the create-react-app, run the below command
Congratulations, you have successfully installed create-react-app
We are running the first Hello World application.
Create react application using the create-react-app hello-react command as shown below
This command help in developing a new folder called the hello-react and thus develop in creating different files and setups the required libraries within the folder and help in making the react project ready to be executed without any additional configuration
Once the project is created, change into the project directory and run the application using the npm start command as shown below
npm start command starts webpack development server which in turn performs all the build process and opens a browser window and loads application URL which runs at http://www.localhost3000.org/ by default.
You will see a beautiful window like the below one, which shows you the react icon and some text.
As discussed, create react app comes with great tooling, one of the productive features is webpack hot reloading, which deploys the change on life and saves the developer lot of time to redeploy and reload work.
Let’s open the project and make some changes to see the experience of this great feature. First, we will go through the project structure to understand the importance of the file created by creating react app.
Open the project created in the previous step in any JS editor, here you see the project is open in vscode editor. On to the left in the explorer section, you see file explorer which shows you several folders and files which were created by create-react-app. Let’sLet’s walk through them.
node_modules: This folder is managed by the package manager (npm) and contains all the project library dependencies. Files in this folder should not be modified as the changes made are not guaranteed to be safe as updating/installing any other library can overwrite the changes made.
public: This folder contains the assets that should be served publicly without any restrictions and contains files like index.html, favicon, manifest.json.
src: This is the folder that contains all your development effort. As a react developer you spent a lot of time in this folder creating components and other sources of code.
Now let’s get into the files inside this folder. To start with index.js is the starting file of this project where the execution of your code starts, this file injects the App component exported from App.js. So all the output you see in the browser is resultant on this file; let’s make some changes to this file; we will edit the existing code with new changes as shown in the below screenshot.
Save the file and switch back to the browser to see the changes deployed and loaded as discussed; this is one of the features of create-react-app to tooling setup.
With new changes, your browser window should look like below.
You can uninstall any library or tool setup via npm install can be uninstalled using npm uninstall. Perform the below step to remove create-react-app installed previously
On command prompt run npm uninstall -g @angular/cli