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

Created on 13 Dec 2017  路  6Comments  路  Source: facebook/create-react-app

Is this a bug report?

No

Can you also reproduce the problem with npm 4.x?

yes

Which terms did you search for in User Guide?

create-react-app

Environment

  1. node -v: v8.9.3
  2. npm -v:4.6.1
  3. yarn --version (if you use Yarn):
  4. npm ls react-scripts (if you haven鈥檛 ejected): C:\Users\chacker\my-react-app>npm ls react-scripts
    [email protected] C:\Users\chacker\my-react-app
    `-- (empty)

Then, specify:

  1. Operating system: windows 7
  2. Browser and version (if relevant):

Steps to Reproduce

(Write your steps here:)

  1. 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]
  2. create-react-app my-app
    log->
    C:\Users\cusha\my-react-app>create-react-app my-app
    'create-react-app' is not recognized as an internal or external command,
    operable program or batch file.

I am not able to start the next step because of these issues. I don't understand why npm is giving this issue is there any problem with my installation.

Most helpful comment

You probably don't have your node modules directory in your path. Does this work with npx?

npx create-react-app my-app

All 6 comments

You probably don't have your node modules directory in your path. Does this work with npx?

npx create-react-app my-app

Thank you. Its working with npx

E:>npx create-react-app sss

Creating a new React app in E:\sss.

Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...

npm ERR! Unexpected end of JSON input while parsing near '...":7,"unpackedSize":22'

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Sathish\AppData\Roaming\npm-cache_logs\2018-06-12T11_17_48_875Z-debug.log

Aborting installation.
npm install --save --save-exact --loglevel error react react-dom react-scripts has failed.

Deleting generated file... package.json
Deleting sss / from E:\
Done.

can you suggest?how can create app?

Try running npx create-react-app my-app in an empty folder

This is the issue is mainly caused by two reasons:

  1. Path variable issue
  2. Npm version issue (5.6.0 above)

if node version is correct and still getting same issue, try adding following path to environment variable,
add correct path from ur system.
C:\Users\vchaudhari\AppData\Roaming\npm.

close all command prompt windows and reopen
sometimes system restart also requires for windows

It is working you're the best

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Aranir picture Aranir  路  3Comments

adrice727 picture adrice727  路  3Comments

JimmyLv picture JimmyLv  路  3Comments

xgqfrms-GitHub picture xgqfrms-GitHub  路  3Comments

ap13p picture ap13p  路  3Comments