Sto provando a distribuire la mia app node.js su heroku ma quando provo a lanciarla localmente usando il caposquadra sto ricevendo un errore: ascolta EADDRINUSE. Ho eseguito un netstat e grepped per la porta che nessun altro lo sta usando e il server si avvia senza problemi quando viene eseguito direttamente come server http del nodo.Porta in uso quando si avvia l'app Node.js con Heroku Foreman
L'app che sto tentando di installare utilizza mongo e redis Non sono sicuro che questi componenti influenzeranno il server a partire da Foreman. Qualcuno ha qualche suggerimento su aree che potrei considerare per potenziali bug?
foreman start
01:37:18 web.1 | started with pid 1835
01:37:18 web.1 | /usr/local/foreman/lib/foreman/process.rb:66: warning: Insecure world writable dir /usr/local in PATH, mode 040777
01:37:19 web.1 | events.js:72
01:37:19 web.1 | throw er; // Unhandled 'error' event
01:37:19 web.1 | ^
01:37:19 web.1 | Error: listen EADDRINUSE
01:37:19 web.1 | at errnoException (net.js:863:11)
01:37:19 web.1 | at Server._listen2 (net.js:1008:14)
01:37:19 web.1 | at listen (net.js:1030:10)
01:37:19 web.1 | at Server.listen (net.js:1096:5)
01:37:19 web.1 | at Function.app.listen (/Users/craig/Documents/Sandboxes /xxx/node_modules/express/lib/application.js:535:24)
01:37:19 web.1 | at Object.<anonymous> (/Users/craig/Documents/Sandboxes/xxx/web.js:25:5)
01:37:19 web.1 | at Module._compile (module.js:456:26)
01:37:19 web.1 | at Object.Module._extensions..js (module.js:474:10)
01:37:19 web.1 | at Module.load (module.js:356:32)
01:37:19 web.1 | at Function.Module._load (module.js:312:12)
01:37:19 web.1 | exited with code 8
01:37:19 system | sending SIGTERM to all processes
SIGTERM received
Grazie.
--Additional informazioni inclusi
Il procfile solo ha una voce: web: nodo web.js
e ho impostato l'ascoltatore come segue:
var port = process.env.PORT || 5000;
app.listen(port, function() {
console.log("Listening on " + port);
});
Si sta tentando di avviare il server HTTP su una porta specifica? (si noti che si dovrebbe usare 'process.env.PORT' come numero di porta ogni volta che si desidera avviare un server HTTP su [tag: heroku]) – fardjad
Si prega di inviare la configurazione dell'app Procfile e node.ks – Winfield
Si prega di trovare i dettagli aggiuntivi richiesti sopra nel post originale – Craig