How to Install React JS On Windows
In this article, We will explain to you how to install react js on windows. ReactJs is an open-source JavaScript library and it is developed by Facebook. react js can be used to make a single-page application(SPA). ReactJS is also used to reuse UI components and run without reloading application so it is scalable, simple, and fast.
Now, we first need to install node js in the system. if not installed node js in your system then you can follow the below URL.
Install Nodejs
How To Install And Download Nodejs on Window Os.
Install React JS On Windows
There are many ways to install react js, but here we can use to create a React application with Create React App.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 | D:\xp_work>npx create-react-app myapp npx: installed 99 in 28.799s Creating a new React app in D:\xp_work\myapp. Installing packages. This might take a couple of minutes. Installing react, react-dom, and react-scripts with cra-template... > core-js@2.6.11 postinstall D:\xp_work\myapp\node_modules\babel-runtime\node_modules\core-js > node -e "try{require('./postinstall')}catch(e){}" > core-js@3.6.4 postinstall D:\xp_work\myapp\node_modules\core-js > node -e "try{require('./postinstall')}catch(e){}" + cra-template@1.0.2 + react-dom@16.13.0 + react-scripts@3.4.0 + react@16.13.0 added 1566 packages from 747 contributors and audited 918958 packages in 406.365s 50 packages are looking for funding run `npm fund` for details found 17 moderate severity vulnerabilities run `npm audit fix` to fix them, or `npm audit` for details Git repo not initialized Error: Command failed: git --version at checkExecSyncError (child_process.js:621:11) at execSync (child_process.js:657:15) at tryGitInit (D:\xp_work\myapp\node_modules\react-scripts\scripts\init.js:46:5) at module.exports (D:\xp_work\myapp\node_modules\react-scripts\scripts\init.js:267:7) at [eval]:3:14 at Script.runInThisContext (vm.js:116:20) at Object.runInThisContext (vm.js:306:38) at Object.<anonymous> ([eval]-wrapper:9:26) at Module._compile (internal/modules/cjs/loader.js:959:30) at evalScript (internal/process/execution.js:80:25) { status: 1, signal: null, output: [ null, null, null ], pid: 3680, stdout: null, stderr: null } Installing template dependencies using npm... > core-js-pure@3.6.4 postinstall D:\xp_work\myapp\node_modules\core-js-pure > node -e "try{require('./postinstall')}catch(e){}" Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library! The project needs your help! Please consider supporting of core-js on Open Collective or Patreon: > https://opencollective.com/core-js > https://www.patreon.com/zloirock Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -) npm WARN eslint-config-react-app@5.2.0 requires a peer of eslint-plugin-flowtype@3.x but none is installed. You must install peer dependencies yourself. npm WARN tsutils@3.17.1 requires a peer of typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta but none is installed. You must install peer dependencies yourself. npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.2 (node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}) npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.11 (node_modules\webpack-dev-server\node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.11: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}) npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.11 (node_modules\watchpack\node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.11: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}) npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.11 (node_modules\jest-haste-map\node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.11: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}) + @testing-library/jest-dom@4.2.4 + @testing-library/react@9.5.0 + @testing-library/user-event@7.2.1 added 38 packages from 55 contributors and audited 919164 packages in 52.726s 51 packages are looking for funding run `npm fund` for details found 17 moderate severity vulnerabilities run `npm audit fix` to fix them, or `npm audit` for details Removing template package using npm... npm WARN eslint-config-react-app@5.2.0 requires a peer of eslint-plugin-flowtype@3.x but none is installed. You must install peer dependencies yourself. npm WARN tsutils@3.17.1 requires a peer of typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta but none is installed. You must install peer dependencies yourself. npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.2 (node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}) npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.11 (node_modules\webpack-dev-server\node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.11: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}) npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.11 (node_modules\watchpack\node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.11: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}) npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.11 (node_modules\jest-haste-map\node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.11: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}) removed 1 package and audited 919163 packages in 26.955s 51 packages are looking for funding run `npm fund` for details found 17 moderate severity vulnerabilities run `npm audit fix` to fix them, or `npm audit` for details Success! Created myapp at D:\xp_work\myapp Inside that directory, you can run several commands: npm start Starts the development server. npm run build Bundles the app into static files for production. npm test Starts the test runner. npm run eject Removes this tool and copies build dependencies, configuration files and scripts into the app directory. If you do this, you can’t go back! We suggest that you begin by typing: cd myapp npm start Happy hacking! |
Run React js application
if you want to run the application then you can follow the below command. if you any change in your app then use the npm run build and after you can run the application.
1 2 | cd myapp npm start |