<\/span><\/h2>\nNext, we will download the script in the node.sh file, and we will give the execute permissions for this file.<\/p>\n
# curl -fsSL https:\/\/deb.nodesource.com\/setup_19.x > node.sh\r\n# chmod +x node.sh<\/pre>\nNow we can run the script using the command:<\/p>\n
# bash node.sh<\/pre>\nOnce this is completed, you can go ahead and install nodejs:<\/p>\n
# apt-get install -y nodejs<\/pre>\nTo test if the node was installed successfully, you can run the node version command:<\/p>\n
# node -v\r\nv19.7.0\r\n<\/pre>\nYou can also check if npm was installed and what is the npm package versions with:<\/p>\n
# npm -v\r\n9.5.0\r\n<\/pre>\nNow you can switch to the non-root user with the command:<\/p>\n
# su - user<\/pre>\nPlease note “user” will depend on the username used on your system; we have used “user” as a generic example.<\/p>\n
Now you can install create-react-app using npm<\/p>\n
$ sudo npm install -g create-react-app<\/pre>\nAnd you can create a new react project:<\/p>\n
$ create-react-app reactapplication<\/pre>\nYou should receive similar output once you run the “create-react-app reactapplication” command:<\/p>\n
\u00a0\r\nCreating a new React app in \/home\/user\/reactapplication.\r\n\r\nInstalling packages. This might take a couple of minutes.\r\nInstalling react, react-dom, and react-scripts with cra-template...\r\n\u00a0\r\n\u00a0\r\nadded 1416 packages in 1m\r\n\u00a0\r\n231 packages are looking for funding\r\n run `npm fund` for details\r\n\u00a0\r\nInstalling template dependencies using npm...\r\n\u00a0\r\nadded 62 packages in 18s\r\n\u00a0\r\n231 packages are looking for funding\r\n run `npm fund` for details\r\nRemoving template package using npm...\r\n\u00a0\r\n\u00a0\r\nremoved 1 package, and audited 1478 packages in 3s\r\n\u00a0\r\n231 packages are looking for funding\r\n run `npm fund` for details\r\n\u00a0\r\n6 high severity vulnerabilities\r\n\u00a0\r\nTo address all issues (including breaking changes), run:\r\n npm audit fix --force\r\n\u00a0\r\nRun `npm audit` for details.\r\n\u00a0\r\nSuccess! Created reactapplication at \/home\/antonio\/reactapplication\r\nInside that directory, you can run several commands:\r\n\u00a0\r\n npm start\r\n Starts the development server.\r\n\u00a0\r\n npm run build\r\n Bundles the app into static files for production.\r\n\u00a0\r\n npm test\r\n Starts the test runner.\r\n\u00a0\r\n npm run eject\r\n Removes this tool and copies build dependencies, configuration files\r\n and scripts into the app directory. If you do this, you can\u2019t go back!\r\n\u00a0\r\nWe suggest that you begin by typing:\r\n\u00a0\r\n cd reactapplication\r\n npm start\r\n\u00a0\r\nHappy hacking!\r\n<\/pre>\nAs you can see, the React project is set up, and you can enter the “reactapplication” directory and start serving the site on http:\/\/localhost:3000.<\/p>\n
$ cd reactapplication \r\n$ npm start 0.0.0.0<\/pre>\nOnce you run the command, you should receive similar output.<\/p>\n
Compiled successfully!\r\n\u00a0\r\nYou can now view reactapp in the browser.\r\n\u00a0\r\n Local: http:\/\/localhost:3000\r\n On Your Network: http:\/\/192.168.100.9:3000\r\n\u00a0\r\nNote that the development build is not optimized.\r\nTo create a production build, use npm run build.\r\n\u00a0\r\nwebpack compiled successfully\r\n<\/pre>\nThe application is now running in development mode, and you can now access it on your browser. To run your application in production mode, you will have to use npm run build. Once the project is compiled, the build directory can then be deployed. You can also serve it using the static server suggested in the output of the command “npm run build”.<\/p>\n
# npm install -g serve\r\n# serve -s build<\/pre>\nThis will install “serve,” and then the second command will serve your site on port 3000.<\/p>\n
Congratulations! You successfully installed ReactJS on Debian 11. You can contact our support if you find any difficulties installing this software and service. All you need to do is to sign up for one of our NVMe VPS plans<\/a> and submit a support ticket. We are available 24\/7.<\/p>\n","protected":false},"excerpt":{"rendered":"In this tutorial, we are going to explain in step-by-step detail how to install ReactJS on Debian 11 OS. React … <\/p>\n
Read More<\/a><\/p>\n","protected":false},"author":4,"featured_media":45042,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1700,13,1712],"tags":[1962,1603,2054],"yoast_head":"\nHow to Install ReactJS on Debian 11\u00a0 - RoseHosting<\/title>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\t \n\t \n\t \n \n \n \n \n \n \n \n\t \n\t \n\t \n