Create-react-app: create react app not wroking

Created on 2 Apr 2019  路  8Comments  路  Source: facebook/create-react-app

Is this a bug report?

(write your answer here)

Did you try recovering your dependencies?

(Write your answer here.)

Which terms did you search for in User Guide?

(Write your answer here if relevant.)

Environment

(paste the output of the command here)

Steps to Reproduce

(Write your steps here:)

  1. i created a folder in my D drive named react
  2. wrote the comand npm init react-app my-app
  3. but it shows the folllowing error.

Expected Behavior


i expected to create my project folder
(Write what you thought would happen.)

Actual Behavior


Screenshot (59)

(Write what happened. Please add screenshots!)
Screenshot (59)

Reproducible Demo

i just started react js using thus command

(Paste the link to an example project and exact instructions to reproduce the issue.)

question

All 8 comments

Hi @sankhadip2000 the command to initialize a new create react app is not npm init react app, it's create-react-app my-new-app and that will scaffold the project. You could create a directory before hand so for ex:

cd Desktop/Coding
create-react-app new-app
cd new-app

@Frankcarvajal Actually this changed semi-recently, and I think npx create-react-app my-app is the favored way as of today, though npm init react-app my-app should work as well.

@sankhadip2000 Try with npx create-react-app my-app and if that doesn't work, paste the output of running npx create-react-app --info.

@heyimalex can I clarify if we need a global install of CRA anymore if npx create-react-app my-app is now preferred. Does npm init react-app my-app need it either?

@verde79 I'm pretty sure that npm init react-app my-app does not require create-react-app to be globally installed; reading the docs for init it seems like it uses npx under the hood.

I'm also facing similar issue on mac, don't understand what is the issue.

Screenshot 2019-05-05 at 12 18 37 AM

More details:
I tried all commands to create react app:

create-react-app my-app
Screenshot 2019-05-05 at 12 21 59 AM

npm init react-app my-app
Screenshot 2019-05-05 at 12 22 17 AM

yarn create react-app my-app
Screenshot 2019-05-05 at 12 22 53 AM

Output file:
package.json
Screenshot 2019-05-05 at 12 23 48 AM

Can you try npm uninstall -g create-react-app followed by npx create-react-app my-app?

Working now. Issue seems like with global installed package.

Was this page helpful?
0 / 5 - 0 ratings