facebook / create-react-app

Set up a modern web app by running one command.
https://create-react-app.dev
MIT License
102.76k stars 26.87k forks source link

create-react-app running error #4180

Closed pindaroli closed 6 years ago

pindaroli commented 6 years ago

Is this a bug report?

yes

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

  1. node -v: v8.10.0

  2. npm -v: from cmd: "CALL "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" prefix -g" non è riconosciuto come comando interno o esterno, un programma eseguibile o un file batch. 5.6.0 npm -v from git bash: 5.7.1

  3. yarn --version (if you use Yarn):

  4. npm ls react-scripts (if you haven’t ejected): no output we are starting from scratch.

Then, specify:

  1. Operating system: Microsoft Windows [Versione 10.0.16299.248]
  2. Browser and version (if relevant): no relevant

Steps to Reproduce

(Write your steps here:) from cmd

  1. C:\Users\olindo>npm install -g create-react-app "CALL "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" prefix -g" non è riconosciuto come comando interno o esterno, un programma eseguibile o un file batch. C:\Users\olindo\AppData\Roaming\npm\create-react-app -> C:\Users\olindo\AppData\Roaming\npm\node_modules\create-react-app\index.js

    • create-react-app@1.5.2 updated 1 package in 3.689s
  2. C:\Users\olindo>create-react-app my-app2

Creating a new React app in C:\Users\olindo\my-app2.

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

events.js:183 throw er; // Unhandled 'error' event ^

Error: spawn C:\WINDOWS\system32\cmd.exe; ENOENT at _errnoException (util.js:1022:11) at Process.ChildProcess._handle.onexit (internal/child_process.js:190:19) at onErrorNT (internal/child_process.js:372:16) at _combinedTickCallback (internal/process/next_tick.js:138:11) at process._tickCallback (internal/process/next_tick.js:180:9) at Function.Module.runMain (module.js:695:11) at startup (bootstrap_node.js:188:16) at bootstrap_node.js:609:3

with Git Bash

  1. $ npm install -g create-react-app C:\Users\olindo\AppData\Roaming\npm\create-react-app -> C:\Users\olindo\AppData\Roaming\npm\node_modules\create-react-app\index.js create-react-app@1.5.2 updated 1 package in 3.284s

  2. create-react-app my-app2

Creating a new React app in C:\Users\olindo.js\my-app2.

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

events.js:183 throw er; // Unhandled 'error' event ^

Error: spawn C:\WINDOWS\system32\cmd.exe; ENOENT at _errnoException (util.js:1022:11) at Process.ChildProcess._handle.onexit (internal/child_process.js:190:19) at onErrorNT (internal/child_process.js:372:16) at _combinedTickCallback (internal/process/next_tick.js:138:11) at process._tickCallback (internal/process/next_tick.js:180:9) at Function.Module.runMain (module.js:695:11) at startup (bootstrap_node.js:188:16) at bootstrap_node.js:609:3

Expected Behavior

the creation of my-app2 directory instrumented with all the software.

Actual Behavior

Only my-app2 and package.json was created no other files (Write what happened. Please add screenshots!) C:\Users\olindo\my-app2>dir Il volume nell'unità C è Windows Numero di serie del volume: 848B-7A22

Directory di C:\Users\olindo\my-app2

19/03/2018 12:53

. 19/03/2018 12:53 .. 19/03/2018 12:53 64 package.json

Reproducible Demo

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

jpalomar commented 6 years ago

👍

@pindaroli i had to downgrade to 0.9.x to get it working. perhaps its an issue with the module's own dependencies.

pindaroli commented 6 years ago

@jpalomar I downgrade create-react-app@0.7 but I have the same problem

bondz commented 6 years ago

@pindaroli try npx create-react-app myapp

andriijas commented 6 years ago

Try upgrading node, npm uninstall -g create-react-app and then use npx like @bondz is suggesting above.

pindaroli commented 6 years ago

@bondz the error is the same with npx

bondz commented 6 years ago

@pindaroli True. That command makesnpx use the already installed version of CRA that wasn't working for you.

Try this instead

npx -p create-react-app -c 'create-react-app myapp'
pindaroli commented 6 years ago

Hi! I tried:

npx -p create-react-app -c 'create-react-app myapp'

output:

C:\Users\olindo.js\test>npx -p create-react-app -c 'create-react-app myapp' "CALL "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npx-cli.js" prefix -g" non è riconosciuto come comando interno o esterno, un programma eseguibile o un file batch. spawn C:\WINDOWS\system32\cmd.exe; ENOENT

Thanks Olindo

2018-03-21 14:35 GMT+01:00 Bond notifications@github.com:

@pindaroli https://github.com/pindaroli True. That command makesnpx use the already installed version of CRA that wasn't working for you.

Try this instead

npx -p create-react-app -c 'create-react-app myapp'

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/facebook/create-react-app/issues/4180#issuecomment-374937751, or mute the thread https://github.com/notifications/unsubscribe-auth/AC_WnGCZhD_vO0Avmk3GaNWKd38EeOOeks5tglcHgaJpZM4SwHDi .

-- Olindo Pindaro http://www.linkedin.com/in/olindopindaro +39 3939455830

bondz commented 6 years ago

@pindaroli I think your installation of NodeJS might be corrupt. Try uninstalling nodejs, and downloading and installing a fresh LTS copy from https://nodejs.org

Timer commented 6 years ago

I'll close this because there's nothing we can help with here. Please file a support ticket with npm and try a full reinstall of your Node environment.

pindaroli commented 6 years ago

Fixex in System Variable there was ComSpec variable to %SystemRoot%\system32\cmd.exe; I removed ";" and all works now! Thanks to all

heshamelmasry77 commented 6 years ago

is there any solution for this ?

pindaroli commented 6 years ago

Yes in my case, using windows, i solved erasing trailig ';' from the command classpath definition,

Regards Olindo

Il giorno ven 11 mag 2018 alle ore 11:45 Hesham El Masry < notifications@github.com> ha scritto:

is there any solution for this ?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/facebook/create-react-app/issues/4180#issuecomment-388316133, or mute the thread https://github.com/notifications/unsubscribe-auth/AC_WnN-hPJqIUpOKOHPtGBQSQ384DzSrks5txV3FgaJpZM4SwHDi .

-- Olindo Pindaro http://www.linkedin.com/in/olindopindaro +39 3939455830

arupdawn commented 6 years ago

@pindaroli

can you please let me know from which file did you removed the trailing ; as you mentioned above as I am also facing similar issue while using the create-react-app command to create an app.

Thanks, Arup Chandra Dawn

pindaroli commented 6 years ago

Control-Panel->SystemProperties-Envirovment Variables->System Variables

"ComSpec" variable edit and look if there is a trailing ";" in definition.

Regards Olindo

Il giorno mar 14 ago 2018 alle ore 19:27 Arup Chandra Dawn < notifications@github.com> ha scritto:

@pindaroli https://github.com/pindaroli

can you please let me know from which file did you removed the trailing ; as you mentioned above as I am also facing similar issue while using the create-react-app command to create an app.

Thanks, Arup Chandra Dawn

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/facebook/create-react-app/issues/4180#issuecomment-412951692, or mute the thread https://github.com/notifications/unsubscribe-auth/AC_WnIeS5AlJzhV1gWqjQNuN8qaz2mjxks5uQwiTgaJpZM4SwHDi .

-- Olindo Pindaro http://www.linkedin.com/in/olindopindaro +39 3939455830