React.js Installation and errors occuring at the time of installation — L3
React.js depends on Node and Node package manager to notifiy the packages used in your web-app . And basically Node uses node package manager to install all new updates and packages.
Common questions ->
What is the purpose of npm?
I know you would say that , installing the packages and updates is only work of NPM . I would like present a scenario , Let’s think you are building a very big project . Your project depends upon around 100+ packages and you have shared project to a friend to install in his system . So how would he know that what are dependencies you are using to run this project ? So here is role of Node package Manager .
Can I run React without Node?
Yes , It’s possible . You have used in HTML .
<script>
document.getElementById(“demo”).innerHTML = “Hello JavaScript!”;
</script>
Same you can insert the React and React-dom script tags in the head section of your HTML page.
<script src="https://unpkg.com/react@18/umd/react.development.js" crossorigin></script>
<script src="https://unpkg.com/react-dom@18/umd/react-dom.development.js" crossorigin></script>
Now let’s install the node and npm , so we can use it for further readings .
Install Node.js and NPM on Windows
Go to https://nodejs.org/en/download/
Click the Windows Installer button to download the latest default version.
Once the downloading is completed and now you know you just have to launch it , don’t change any default settings and just install.
Congratulations if it is working . If not ,leave a comment , I will surely resolve your issue and conclude in the article .
Now if it is installed , how I can verify it’s working or not . So I have to check by using this
node -v
npm -v
It will show us the version of node and npm .
Now for installing react in some project , you can use Create-react-app. Create-react -app sets up a environment for the developement and optimise app for production.
npx create-react-app firstapp
cd firstapp
npm start
Now your React.js application is running .
If any error occured during this setup. Please write in the comment .I will try to resolve soon and conclude in this article .
Thanks for reading this content . If you loved this, try to add in reading list.