I am trying to set up react app using create-react-app command on windows pc. I already used it on my mac computer, and it works well. But I encounter a problem. Here my steps on command line. Am i missing something?
C:\Windows\system32>cd C:\Users\ugur\Desktop\deneme C:\Users\ugur\Desktop\deneme>npm init This utility will walk you through creating a package.json file. It only covers the most common items, and tries to guess sensible defaults. See 'npm help json' for definitive documentation on these fields and exactly what they do. Use 'npm install <pkg> --save' afterwards to install a package and save it as a dependency in the package.json file. Press ^C at any time to quit. name: (deneme) version: (1.0.0) description: entry point: (index.js) test command: git repository: keywords: license: (ISC) About to write to C:\Users\ugur\Desktop\deneme\package.json: { "name": "deneme", "version": "1.0.0", "description": "", "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "author": "Ugur <[email protected]> (http://www.abc.com.tr)", "license": "ISC" } Is this ok? (yes) C:\Users\ugur\Desktop\deneme>npm install -g create-react-app C:\Users\ugur\AppData\Roaming\npm\create-react-app -> C:\Users\ugur\ AppData\Roaming\npm\node_modules\create-react-app\index.js C:\Users\ugur\AppData\Roaming\npm `-- [email protected] +-- [email protected] | +-- [email protected] | +-- [email protected] | +-- [email protected] | | `-- [email protected] | +-- [email protected] | `-- [email protected] +-- [email protected] | +-- [email protected] | | +-- [email protected] | | `-- [email protected] | `-- [email protected] | `-- [email protected] +-- [email protected] `-- [email protected] C:\Users\ugur\Desktop\deneme>create-react-app new_app 'create-react-app' is not recognized as an internal or external command, operable program or batch file.
Also npm configuration path is like
C:\Users\ugur\AppData\Roaming\npm\node_modules\create-react-app\
Use npx to solve the error "create-react-app is not recognized as an internal or external command, operable program or batch file", e.g. npx create-react-app my-app or install the package globally by running npm install -g create-react-app . The fastest way to solve the error is to use the npx command.
To solve the error "react-scripts is not recognized as an internal or external command, operable program or batch file", open your terminal in your project's root directory and install the react-scripts package by running npm install react-scripts and clear your npm cache if necessary.
Create React App is a comfortable environment for learning React, and is the best way to start building a new single-page application in React. npx on the first line is not a typo — it's a package runner tool that comes with npm 5.2+.
If you really need create-react-app , you might need to reinstall Node and reconfigure your dependencies to ensure you have a fresh start with Node, npm, npx, and the like.
Try with this npx create-react-app my-app
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With