Dejenme ponerlos en contexto. Recientemente he empezado a aprender react. Yo uso Windows 10 con WSL "windows subsystem for linux" y Ubuntu instalados en adición a esto yo trabajo con Hyper terminal al cual le instalé ZSH y "oh my ZSH".
Actualmente tengo instalado en la terminal (ZSH) Node.js versión (12.1.0) y NPM (6.9.0)
El problema empieza luego de crear un proyecto con React al intentar correr el comando "npm start"
Pasos para reproducir el error:
npx create-react-app my-app
cd my-app
npm start
luego de ejecutar NPM start me aparece esto:
events.js:173
throw er; // Unhandled 'error' event
^
Error: spawn cmd.exe ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:248:19)
at onErrorNT (internal/child_process.js:431:16)
at processTicksAndRejections (internal/process/task_queues.js:84:17)
Emitted 'error' event at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:254:12)
at onErrorNT (internal/child_process.js:431:16)
at processTicksAndRejections (internal/process/task_queues.js:84:17)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/roguesquid/.npm/_logs/2019-05-04T14_02_48_006Z-debug.log
Y en el log me aparece esto:
0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'start' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle [email protected]~prestart: [email protected]
6 info lifecycle [email protected]~start: [email protected]
7 verbose lifecycle [email protected]~start: unsafe-perm in lifecycle true
8 verbose lifecycle [email protected]~start: PATH: /usr/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/mnt/c/Users/$9 verbose lifecycle [email protected]~start: CWD: /mnt/c/Users/luisr/my-app
10 silly lifecycle [email protected]~start: Args: [ '-c', 'react-scripts start' ]
11 silly lifecycle [email protected]~start: Returned: code: 1 signal: null
12 info lifecycle [email protected]~start: Failed to exec start script
13 verbose stack Error: [email protected] start: `react-scripts start`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)
13 verbose stack at EventEmitter.emit (events.js:196:13)
13 verbose stack at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:196:13)
13 verbose stack at maybeClose (internal/child_process.js:1000:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:267:5)
14 verbose pkgid [email protected]
15 verbose cwd /mnt/c/Users/luisr/my-app
16 verbose Linux 4.4.0-17134-Microsoft
17 verbose argv "/usr/bin/node" "/usr/bin/npm" "start"
18 verbose node v12.1.0
19 verbose npm v6.9.0
20 error code ELIFECYCLE
21 error errno 1
22 error [email protected] start: `react-scripts start`22 error Exit status 1
23 error Failed at the [email protected] start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
PD: Tengo instalado node en Windows tambien y al intentar correr "npm start" sucede lo mismo.