create-react-app icon indicating copy to clipboard operation
create-react-app copied to clipboard

Error while Installing react-scripts with create a new project

Open HrudakovSerhii opened this issue 9 years ago • 17 comments

Description

I get an error after creating new react app. It's say about Error at spawn ENOTDIR

Expected behavior

Project should created and add list of files inside a package. For me it's a first time i'm using it (begginer with ReactJS), so mb something wrong with my settings or anything else related with it.

Actual behavior

Its just fall with an error. CRA can't install react scripts.

Environment

MBP

Run these commands in the project folder and fill in their results:

  1. npm ls react-scripts (if you haven’t ejected):
  2. node -v: v7.2.1
  3. npm -v: 4.0.3

Then, specify:

  1. Operating system: MacOS Sierra 10.12.1
  2. Browser and version: Chrome 54.0.2840.98 (64-bit)

Reproducible Demo

This is screenshot of my terminal window: 2016-12-08 00 54 58

HrudakovSerhii avatar Dec 08 '16 00:12 HrudakovSerhii

One thing that looks a bit weird is you're running the command from inside the Trash folder. Is this intentional? I don't know if there's anything preventing that but just curious if you tried creating a project outside of it.

gaearon avatar Dec 08 '16 00:12 gaearon

Yes, really weird... Now i try to create in non-Trash folder. And again same result:

2016-12-08 02 39 47

HrudakovSerhii avatar Dec 08 '16 01:12 HrudakovSerhii

@fson Looks like Yarn detection code needs a try catch?

gaearon avatar Dec 08 '16 01:12 gaearon

I don’t understand why this happens. Can you give me the output of:

  • echo $PATH
  • which yarn
  • create-react-app --version

Then could you try to run npm i -g [email protected] and try again. This way we can tell if it’s a new regression or not.

gaearon avatar Dec 08 '16 14:12 gaearon

Ohh, yes! I forget instal yarn.. Sorry guys, it was my mistake. Now it's okay. Should i close issue?

HrudakovSerhii avatar Dec 08 '16 15:12 HrudakovSerhii

Hmm, it still shouldn't fail without Yarn. Yarn is not required for CRA. I'm going to put try / catch around this code and release an update.

gaearon avatar Dec 08 '16 15:12 gaearon

Great! Thank you.

HrudakovSerhii avatar Dec 08 '16 15:12 HrudakovSerhii

@SerhiiHrudakov Could you still share the output of commands in https://github.com/facebookincubator/create-react-app/issues/1200#issuecomment-265757559?

gaearon avatar Dec 08 '16 15:12 gaearon

2016-12-08 16 19 22

Then list of files and next:

2016-12-08 16 19 59

Is it what you ask?

HrudakovSerhii avatar Dec 08 '16 15:12 HrudakovSerhii

Sorry, could you run these commands in the terminal:

echo $PATH
which yarn
create-react-app --version

gaearon avatar Dec 08 '16 15:12 gaearon

Ohh, sorry. Here it is:

2016-12-08 16 44 48

HrudakovSerhii avatar Dec 08 '16 15:12 HrudakovSerhii

Thanks!

As a matter of experiment, could you remove Yarn and try again with [email protected] I just released?

npm uninstall -g yarn
npm install -g [email protected]

create-react-app my-app

I just want to make sure the issue is fixed. Feel free to install Yarn again afterwards (it's faster) :-)

gaearon avatar Dec 08 '16 15:12 gaearon

This is deleting yarn: 2016-12-08 16 50 32

Then create new CRA: 2016-12-08 16 51 24

And result: 2016-12-08 16 51 39

HrudakovSerhii avatar Dec 08 '16 15:12 HrudakovSerhii

There is a typo in uninstall command so it didn't get uninstalled. You typed usinstal, not uninstall.

Could you try this again please? Sorry for bugging you.

gaearon avatar Dec 08 '16 15:12 gaearon

Ooo...really... Wait a minute please.

HrudakovSerhii avatar Dec 08 '16 15:12 HrudakovSerhii

2016-12-08 16 59 05 2016-12-08 16 59 51

HrudakovSerhii avatar Dec 08 '16 16:12 HrudakovSerhii

Hmm, you still have Yarn. Maybe you didn't install it via npm? Anyway, don't worry, it's not super important. I'm glad it works for you now.

gaearon avatar Dec 08 '16 16:12 gaearon