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

Dung Do Tien Jun 05 2021 342

I am trying to set up react app using create-react-app command on windows pc. But I encounter error 'create-react-app' is not recognized as an internal or external command.

with the same command, it works for me on my MacOs. Below is the error detail:

C:\Users\ugur\Desktop\deneme>npm install -g create-react-app
C:\Users\ugur\AppData\Roaming\npm\create-react-app -> C:\Users\ugurAppData\Roaming\npm\node_modules\create-react-app\index.js
C:\Users\ugur\AppData\Roaming\npm
`-- create-react-app@0.2.0
  +-- chalk@1.1.3
  | +-- ansi-styles@2.2.1
  | +-- escape-string-regexp@1.0.5
  | +-- has-ansi@2.0.0
  | | `-- ansi-regex@2.0.0
  | +-- strip-ansi@3.0.1
  | `-- supports-color@2.0.0
  +-- cross-spawn@4.0.0
  | +-- lru-cache@4.0.1
  | | +-- pseudomap@1.0.2
  | | `-- yallist@2.0.0
  | `-- which@1.2.10
  |   `-- isexe@1.1.2
  +-- minimist@1.2.0
  `-- semver@5.3.0

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.

How can I resolve this issue?

Have 2 answer(s) found.
  • T

    Trọng Hiếu Jun 05 2021

     You need to re-install the latest version of node and try the latest version of React.

    npm install -g npm-windows-upgrade
    npm-windows-upgrade

    And then

    npm install -g create-react-app
    create-react-app my-app

    I hope it useful for you!

  • K

    Kingtub Kakkak Jun 05 2021

    I solved the problem by adding C:\Users\ugur\AppData\Roaming\npm to the windows PATH variable.

    Pls check correct path to npm folder.

Leave An Answer
* NOTE: You need Login before leave an answer

* Type maximum 2000 characters.

* All comments have to wait approved before display.

* Please polite comment and respect questions and answers of others.

Popular Tips

X Close