Oi.
Estou tentando inicializar o aplicativo do react (curso numero 1), usando 'npm start' na pasta cdc-admin localizada neste diretório: 'C:\Users\Marcelo\AppData\Roaming\npm\cdc-admin>'
Mas estou recebendo um erro.
No terminal aparece isso:
"Starting the development server...
events.js:174 throw er; // Unhandled 'error' event ^
Error: spawn cmd ENOENT
at Process.ChildProcess.handle.onexit (internal/childprocess.js:240:19)
at onErrorNT (internal/child_process.js:415:16)
at process.tickCallback (internal/process/nexttick.js:63:19)
Emitted 'error' event at:
at Process.ChildProcess.handle.onexit (internal/childprocess.js:246:12)
at onErrorNT (internal/child_process.js:415:16)
at process.tickCallback (internal/process/nexttick.js:63:19)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! cdc-admin@0.1.0 start: react-scripts start
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the cdc-admin@0.1.0 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! C:\Users\Marcelo\AppData\Roaming\npm-cache_logs\2019-08-05T19_21_38_023Z-debug.log
C:\Users\Marcelo\AppData\Roaming\npm\cdc-admin>"
Esse é meu LOG do erro:
"
0 info it worked if it ends with ok
1 verbose cli [ 'C:\Program Files\nodejs\node.exe',
1 verbose cli 'C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js',
1 verbose cli 'start' ]
2 info using npm@6.9.0
3 info using node@v10.16.0
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle cdc-admin@0.1.0prestart: cdc-admin@0.1.0
6 info lifecycle cdc-admin@0.1.0start: cdc-admin@0.1.0
7 verbose lifecycle cdc-admin@0.1.0start: unsafe-perm in lifecycle true
8 verbose lifecycle cdc-admin@0.1.0start: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\Marcelo\AppData\Roaming\npm\cdc-admin\node_modules.bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\php;C:\Program Files\nodejs;C:\Program Files\Git\cmd;"C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;";C:\Ruby25-x64\bin;C:\Program Files\MySQL\MySQL Shell 8.0\bin9 verbose lifecycle cdc-admin@0.1.0start: CWD: C:\Users\Marcelo\AppData\Roaming\npm\cdc-admin
10 silly lifecycle cdc-admin@0.1.0start: Args: [ '/d /s /c', 'react-scripts start' ]
11 silly lifecycle cdc-admin@0.1.0start: Returned: code: 1 signal: null
12 info lifecycle cdc-admin@0.1.0start: Failed to exec start script
13 verbose stack Error: cdc-admin@0.1.0 start: react-scripts start
13 verbose stack Exit status 1
13 verbose stack at EventEmitter. (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:301:16)
13 verbose stack at EventEmitter.emit (events.js:198:13)
13 verbose stack at ChildProcess. (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:198:13)
13 verbose stack at maybeClose (internal/child_process.js:982:16)
13 verbose stack at Process.ChildProcess.handle.onexit (internal/childprocess.js:259:5)
14 verbose pkgid cdc-admin@0.1.0
15 verbose cwd C:\Users\Marcelo\AppData\Roaming\npm\cdc-admin
16 verbose Windows_NT 10.0.17134
17 verbose argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "start"
18 verbose node v10.16.0
19 verbose npm v6.9.0
20 error code ELIFECYCLE
21 error errno 1
22 error cdc-admin@0.1.0 start: react-scripts start
22 error Exit status 1
23 error Failed at the cdc-admin@0.1.0 start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
"
Lembro que fiz alterações nas variáveis do sistema.
Para solucionar isso, adicionei alguns valores, que penso ser padrão do windows 10.
Esses são os valores que tenho na variável "Path" do sistema:
"C:\Program Files (x86)\Common Files\Oracle\Java\javapath"
"C:\php"
"C:\Program Files\nodejs"
"C:\Program Files\Git\cmd"
"C:\Windows\system32"
"C:\Windows"
"C:\Windows\System32\Wbem"
O problema é que não estou conseguindo rodar normalmente o "npm start", o servidor não roda, e recebo erro.
Têm alguma sugestão?
Como posso proceder?
Obrigado.