I do assume that you do not have anything installed in your Ubuntu system. So first we will install nodejs and npm using:

sudo apt-get install nodejs npm

Now make project directory to build app:

mkdir reactApp
cd reactApp

Now to initialize your npm project and add all your project lib/dependencies. Just press enter for all of the question asked during the npm init.

npm init
npm install webpack –save
npm install webpack-dev-server –save
npm install react –save

You can also use the library created by the facebook developer to bootstrap a react project so that you do not have to worry about webpack:

Now run npm

npm install – g create-react-app

Then after it has been installed globally, you can now use it to create a project

create-react-app projectname

Project name  all in lowercase or you will get an error. Now,

cd projectname

Cheer J all over

npm start or yarn will start up your program at port 3000

Share This