''create-react-app' is not recognized as an internal or external command

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\



Solution 1:[1]

Try with this npx create-react-app my-app

Solution 2:[2]

simply putting 'npx' in front of the command will solve this if you are running older version of node.

try this and it will work fine.

npx create-react-app [yourProjectName]

Solution 3:[3]

I'm adding this because this pops up on Google and I was having trouble.

I'm on Windows 10 and I searched for 'create-react-app' in C:\ and the path was C:\Users\Admin\AppData\Roaming\npm\node_modules.

I added that to the Environment Variables > Path and the command works now.

Solution 4:[4]

Use npx create-react-app my-app. This will solve any issue with the system path variable.

React GitHub documentation suggests this as well. Read Here

Solution 5:[5]

First Check your Node version. if your node version is 8 or greater then 8 then use
'npx create-react-app my-app'

In the above version we need to change only one word that is npx

You don't need to do another things. I hope this will help you

Solution 6:[6]

Another one that might work is to use Powershell and type:

npx create-react-app new_app --use-npm

Solution 7:[7]

I also get same problem but I resolve it by following steps

  1. Check your global directory by using command npm root -g
  2. check the folder, will it have .cmd of your installed packages.
  3. If yes, Please copy the path of folder and put in path of user variables.

Thanks

Solution 8:[8]

I had to add c:\node_modules.bin to my path to run create-react-app

Do a search for create-react-app and use that in your path.

Solution 9:[9]

  • Run : npx install create-react-app nameOfYourFolder instead of npm install create-react-app nameOfYourFolder (npx comes with npm 5.2+ and higher)
  • Then : cd nameOfYourFolder
  • Then run : npm start

You can find more in React documentation here

Solution 10:[10]

Do the following from TERMINAL:

  • cd myReactApp
  • npx create-react-app .

This should work!

Solution 11:[11]

User following command

npx create-react-app my-app

Solution 12:[12]

I faced the same issue despite having

npm install create-react-app --global

Later tried

npm init react-app projectname

This worked for me and it created a React project. Also this worked

npx create-react-app projectname

Solution 13:[13]

This is the issue is mainly caused by two reasons:

  1. Path variable issue
  2. Npm version issue

Add C:\Users\ugur\AppData\Roaming\npm to Windows PATH variable and upgrade npm version to 5.5.1

Solution 14:[14]

This is a windows variable path problem, i have faced the same problem recently, the following are possible root cause of the problem , installing node via nvm(node version manager) so to solve the issue in this case you after running npm install -g create-react-app got to the location in my case C:\Users\pc\AppData\Roaming\npm in the copy create-react-app to C:\Users\pc\AppData\Roaming\nvm\v12.18.3 and also move the folder in node_module folder called create-react-app to the specific version you are using under nvm , after that you should be able to use create-react-app without and issue. i hope this will help someone

Solution 15:[15]

Adding npx to the command solves the problem and react app is created e.g:

$ npx create-react-app my-react-app

Solution 16:[16]

By installing react globally this error can be solved for those who didn't get even after the environmental variable is set. npm i -g create-react-app . Now the modules will be installed.

Solution 17:[17]

If above solution not working try this on it will work 100%

0)first of all install package "npm create-create-app -g" or "yarn add create-react-app" then

1)open cmd and type "npm root -g" this command will give you path of node_model directory for global packages

2) copy that path only upto npm directory eg.C:\Users\vchaudhari\AppData\Roaming\npm

3) open environmental variables in windows and pest that command in that save it .

4) close current cmd and open new cmd and use command "create-react-app demoapp"

5) Enjoy :-)

Solution 18:[18]

Environment node -v: v8.9.3 npm -v:4.6.1 yarn --version (if you use Yarn): npm ls react-scripts (if you haven’t ejected): C:\Users\chacker\my-react-app>npm ls react-scripts [email protected] C:\Users\chacker\my-react-app `-- (empty) Then, specify:

Operating system: windows 7 Browser and version (if relevant): Steps to Reproduce (Write your steps here:)

npm install -g create-react-app log-> C:\Users\chacker\my-react-app>npm install -g create-react-app C:\Users\chacker\AppData\Roaming\npm\create-react-app -> C:\Users\chacker\AppData\R aming\npm\node_modules\create-react-app\index.js C:\Users\chacker\AppData\Roaming\npm `-- [email protected] create-react-app my-app

Solution 19:[19]

This command requires the Expo-CLI. If you want to save time I recommend to you the Node.js command prompt and it will add the necessary dependencies automatically.

Solution 20:[20]

For me just create-react-app project-name worked after adding path C:\Users\user\AppData\Roaming\npm\node_modules to my environment variables.

Solution 21:[21]

I solved the problem by using Node.js command prompt as an administrator

Solution 22:[22]

Someone who is still having this issue, Go to C:\Users\user\AppData\Roaming\npm- check if .cmd is create-react- app or creact-react-native-app.

Mine was the latter.

Also, make sure you don't have two different version installed.

Solution 23:[23]

I was trying to create an app on my PC with Windows PowerShell. I tried updating and setting up environment variables accordingly. But nothing worked for me until I followed these steps.

  1. npm install create-react-app
  2. npx create-react-app

and then it started working. Use these commands in the same sequence.

Solution 24:[24]

This worked for me, seems the create react app has version issue, adding @latest solves it, installing it in local is by no means useful as the use of npx is to get latest version from remote repository that from local.

npx create-react-app@latest react-webdev-course

Solution 25:[25]

I solved my problem by following steps

  1. npm install -g create-react-app To install react app globally
  2. create-react-app version To check if it is installed and if its installed then what's the version.
  3. create-react-app [name]
  4. cd [name]
  5. npm start

Solution 26:[26]

documentation says: npm init react-app my-app

reference: https://github.com/facebook/create-react-app

Solution 27:[27]

I solved the problem by uninstalling create-react-app:

npm uninstall create-react-app

then install with the following command:

npm install -g create-react-app

Solution 28:[28]

I solved problem by following below steps

1) open Node.js command prompt

2) Then type "npm install create-react-app -g" (g for global access) command to install create-react-app

3) Then type "npm install create-react-native-app -g" (g for global access) command to install create-react-native-app

Follow step #2 for use create-react-app

Follow step #3 only if you want to use create-react-native-app otherwise its optional.

Solution 29:[29]

I reinstalled node.js and added the path given by npm root -g command to my path variable to get it working.