Eu fiz tudo certinho
const express = require('express')
const app = express()
app.listen(3000, () => console.log('servidor rodando na porta 3000'))
app.get('/', (req,res) => res.send('servidor rodandno, tudo ok'))
E apos o "node index.js" o resultado é:
events.js:353 throw er; // Unhandled 'error' event ^
Error: listen EADDRINUSE: address already in use :::3000 at Server.setupListenHandle [as listen2] (net.js:1318:16) at listenInCluster (net.js:1366:12) at Server.listen (net.js:1452:7) at Function.listen (/home/wesleyvmartins/Área de trabalho/Progamacao/estudo/estudo/Alura/NodeJS/API REST/nodemodules/express/lib/application.js:618:24) at Object. (/home/wesleyvmartins/Área de trabalho/Progamacao/estudo/estudo/Alura/NodeJS/API REST/index.js:5:5) at Module.compile (internal/modules/cjs/loader.js:1068:30) at Object.Module.extensions..js (internal/modules/cjs/loader.js:1097:10) at Module.load (internal/modules/cjs/loader.js:933:32) at Function.Module.load (internal/modules/cjs/loader.js:774:14) at Function.executeUserEntryPoint [as runMain] (internal/modules/runmain.js:72:12) Emitted 'error' event on Server instance at: at emitErrorNT (net.js:1345:8) at processTicksAndRejections (internal/process/task_queues.js:82:21) { code: 'EADDRINUSE', errno: -98, syscall: 'listen', address: '::', port: 3000 } [wesleyvmartins@fedora API REST]$ node index.js events.js:353 throw er; // Unhandled 'error' event ^
Error: listen EADDRINUSE: address already in use :::3000 at Server.setupListenHandle [as listen2] (net.js:1318:16) at listenInCluster (net.js:1366:12) at Server.listen (net.js:1452:7) at Function.listen (/home/wesleyvmartins/Área de trabalho/Progamacao/estudo/estudo/Alura/NodeJS/API REST/nodemodules/express/lib/application.js:618:24) at Object. (/home/wesleyvmartins/Área de trabalho/Progamacao/estudo/estudo/Alura/NodeJS/API REST/index.js:5:5) at Module.compile (internal/modules/cjs/loader.js:1068:30) at Object.Module.extensions..js (internal/modules/cjs/loader.js:1097:10) at Module.load (internal/modules/cjs/loader.js:933:32) at Function.Module.load (internal/modules/cjs/loader.js:774:14) at Function.executeUserEntryPoint [as runMain] (internal/modules/runmain.js:72:12) Emitted 'error' event on Server instance at: at emitErrorNT (net.js:1345:8) at processTicksAndRejections (internal/process/task_queues.js:82:21) { code: 'EADDRINUSE', errno: -98, syscall: 'listen', address: '::', port: 3000 }
Alguem poderia me ajudar, já tentei algumas vezes e realmente não consegui resolver. desde já agradeço.