React Setting up the project
You need Node Package Manager to install the project dependencies. Download node for your operating system from Nodejs.org. Node Package Manager comes with node.
You can also use Node Version Manager to better manage your node and npm versions. It is great for testing your project on different node versions. However, it is not recommended for production environment.
Once you have installed node on your system, go ahead and install some essential packages to blast off your first React project using Babel and Webpack.
Before we actually start hitting commands in the terminal. Take a look at what Babel and Webpack are used for.
You can start your project by running npm init in your terminal. Follow the initial setup. After that, run following commands in your terminal
Optional Dev Dependencies:
Create .babelrc in your project root with following contents:
Optionally create .eslintrc in your project root with following contents:
Create a .gitignore file to prevent uploading generated files to your git repo.
Create webpack.config.js file with following minimum contents.
And finally, create a sever.js file to be able to run npm start, with following contents:
Create src/app.js file to see your React project do something.
Run node server.js or npm start in the terminal, if you have defined what start stands for in your package.json