3
respostas

Servidor não sobe no curso de TypeScript parte 2 aula 4

Ao tentar subir o servidor a seguinte mensagem de erro é exibida no log:

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.4.1
3 info using node@v8.12.0
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle app@1.0.0~prestart: app@1.0.0
6 info lifecycle app@1.0.0~start: app@1.0.0
7 verbose lifecycle app@1.0.0~start: unsafe-perm in lifecycle true
8 verbose lifecycle app@1.0.0~start: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\jonat_000\source\repos\api\node_modules\.bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\ProgramData\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\WINDOWS\System32\OpenSSH\;C:\Program Files (x86)\dotnet\;C:\Program Files\dotnet\;C:\Program Files (x86)\IncrediBuild;C:\Program Files\Git\cmd;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\;C:\Program Files\Microsoft SQL Server\140\Tools\Binn\;C:\Program Files\Microsoft SQL Server\140\DTS\Binn\;C:\Program Files (x86)\MySQL\MySQL Utilities 1.6\;C:\Program Files (x86)\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\140\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\ManagementStudio\;C:\Program Files\nodejs\;C:\Users\jonat_000\AppData\Local\Microsoft\WindowsApps;C:\Users\jonat_000\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\jonat_000\AppData\Roaming\npm
9 verbose lifecycle app@1.0.0~start: CWD: C:\Users\jonat_000\source\repos\api
10 silly lifecycle app@1.0.0~start: Args: [ '/d /s /c', 'node server.js' ]
11 silly lifecycle app@1.0.0~start: Returned: code: 1  signal: null
12 info lifecycle app@1.0.0~start: Failed to exec start script
13 verbose stack Error: app@1.0.0 start: `node server.js`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:301:16)
13 verbose stack     at emitTwo (events.js:126:13)
13 verbose stack     at EventEmitter.emit (events.js:214:7)
13 verbose stack     at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack     at emitTwo (events.js:126:13)
13 verbose stack     at ChildProcess.emit (events.js:214:7)
13 verbose stack     at maybeClose (internal/child_process.js:915:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
14 verbose pkgid app@1.0.0
15 verbose cwd C:\Users\jonat_000\source\repos\api
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 v8.12.0
19 verbose npm  v6.4.1
20 error code ELIFECYCLE
21 error errno 1
22 error app@1.0.0 start: `node server.js`
22 error Exit status 1
23 error Failed at the app@1.0.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 ]

Poderiam me ajudar a resolver o problema?

3 respostas

Oi Jonathas, tudo bem? É a API externa? Isso é impresso quando executa o npm start?

Exatamente, quando eu tentei subir o servidor (npm start na aplicação API escrita em Node.js) para simular o acesso a uma fonte externa ele deu este erro. De qualquer forma eu utilizei um gerador externo e continuei o curso.

Entendi, eu testei aqui e não tive problemas. Acho que vale apena atualizar o node. Testa pra gente? Eu usei a versão 8 do node