1
resposta

Erro ao rodar o nodemon

Instalei o nodemon, e alterei o arquivo app.js. Rodei o comando "nodemon app" e exibiu o erro abaixo:

nodemon app [nodemon] 1.11.0 [nodemon] to restart at any time, enter rs [nodemon] watching: . [nodemon] starting node app index.js events.js:141 throw er; // Unhandled 'error' event ^

Error: listen EADDRINUSE :::3000 at Object.exports._errnoException (util.js:870:11) at exports._exceptionWithHostPort (util.js:893:20) at Server._listen2 (net.js:1237:14) at listen (net.js:1273:10) at Server.listen (net.js:1369:5) at EventEmitter.listen (/home/bernadete/Curso Javascript/casadocodigo/node_modules/express/lib/application.js:618:24) at Object. (/home/bernadete/Curso Javascript/casadocodigo/app.js:10:5) at Module._compile (module.js:410:26) at Object.Module._extensions..js (module.js:417:10) at Module.load (module.js:344:32) [nodemon] app crashed - waiting for file changes before starting... [nodemon] restarting due to changes... [nodemon] starting node app index.js events.js:141 throw er; // Unhandled 'error' event ^

Error: listen EADDRINUSE :::3000 at Object.exports._errnoException (util.js:870:11) at exports._exceptionWithHostPort (util.js:893:20) at Server._listen2 (net.js:1237:14) at listen (net.js:1273:10) at Server.listen (net.js:1369:5) at EventEmitter.listen (/home/bernadete/Curso Javascript/casadocodigo/node_modules/express/lib/application.js:618:24) at Object. (/home/bernadete/Curso Javascript/casadocodigo/app.js:11:5) at Module._compile (module.js:410:26) at Object.Module._extensions..js (module.js:417:10) at Module.load (module.js:344:32) [nodemon] app crashed - waiting for file changes before starting...

Poderiam me ajudar?

1 resposta

Se você já instalou o nodemon, tente ver se está rodando algo na porta 3000.

Considerando que você usa um sistema baseado em UNIX:

 lsof -w -n -i tcp:3000

Depois, tente matar o processo que está rodando pelo PID:

kill -9 <PID>