Building React using npm

Neal Oh
2 min readOct 27, 2020

--

Is an open-source, front-end, JavaScript library for building user interfaces or UI components. It’s great if you want to build HTML and JS together. I mostly use this to build mostly to create a social blog with bootstrap and nothing else. In order to launch react, go to terminal write ‘yarn start’ which will allow your project to launch the front-end of react. However, you don't have to always use yarn, you can also use npm to launch react. I don’t know what’s the difference between npm and yarn, but they both do the same thing. Very recently, I created a new react project by typing in the terminal below:

create-react-app content

Once it was created, I tried launching (using ‘npm start’) the project just for a test. I gave me an error saying that it’s not compiled. To resolve this problem, make sure you type this in your terminal:

npm install — save resolve-url-loader — dev

This will help resolve your npm loader. NOTE: If you are using npm, follow the instructions on this blog. If you are using yarn, follow along as well, but instead of using npm, change all of it into yarn.

If you are going to use a router or bootstrap, make sure you add this in your terminal below:

npm install react-router-dom

npm i — save-dev bootstrap@next bootstrap-loader tether jquery

npm install popper.js — save

The first one above will allow the program to add react-router-dom into your project. Important: Make sure you install this to where your project is created. The second and third commands are for if you want to install bootstrap and adding proper features such as creating a navbar. Also, just to be safe, if you are having trouble with the router not working properly, add this to your terminal to fix the issue:

npm install — save react-router-dom

--

--

Neal Oh

Full-Stack Developer & Software Engineering from Flatiron