To run this application, first, you will have to change your directory to the application: cd Īnd finally, start the application using the following command: npm start It will take a couple of minutes and if things go smoothly, you will get the following message after the successful installation of your application: To create a react application, all you have to do is append the desired name of the application to the create-react-app command: create-react-app įor example, here, I created a sample application named learnubuntu: create-react-app learnubuntu In this section, I will walk you through how you can create a sample react application from the installation you've made previously. Once you are done with the installation, check the installed version: create-react-app -version How to create React application on Ubuntu Unlike the previous installation, you will have to use the npm package manager to install this package: sudo npm -g install create-react-app If you don't know, the create-react-app utility avails you of every necessary tool that is used to create a react application. Now, log out and log back in and check the node version: How to install the create-react-app utility To update the node, all you need is a tool named n which can be installed with the npm: npm install -g nĪnd finally, install the latest LTS release of Node (18.14.2 while writing): sudo n lts So let's update the Node to the latest version. That's a pretty old version and it won't work with the create-react-app utility. To confirm the installation, you can check the installed version of npm using the following command: npm -versionĪnd to check the node version, you can use the following command: node -version Once you have enabled the universe repository, use the following command to install react: sudo apt install npm So if you haven't added the universe repository, you can refer to our detailed guide on how to add the universe and multiverse repository on Ubuntu. To install react, you must install npm first, which is available from the universe repository. The best way to get react is to install the create-react-app node module. There is no separate React package in Ubuntu.
0 Comments
Leave a Reply. |