knpwrs / nws

A simple tool designed to launch a simple static web server in your current working directory.
https://npmjs.org/package/nws
MIT License
25 stars 7 forks source link

Error on start #4

Closed ImanMh closed 9 years ago

ImanMh commented 9 years ago

Hi, I was using nws without any issues but now when I run nws it gives me this error:

events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: listen EADDRINUSE
    at errnoException (net.js:904:11)
    at Server._listen2 (net.js:1042:14)
    at listen (net.js:1064:10)
    at Server.listen (net.js:1138:5)
    at Object.<anonymous> (/usr/local/lib/node_modules/nws/lib/index.js:52:37)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
tkrugg commented 9 years ago

You probably still have the previous process running (or the remains of it). You could try changing the port number for this process.

ImanMh commented 9 years ago

Yes you are right, thank you. That would be handy to have a message like port already in use in the next version.

knpwrs commented 9 years ago

This is a common error with Node applications. I'll look into making it more user friendly when using nws.

knpwrs commented 9 years ago

Just published version 0.5.1 which features user-friendly error messages in the event of the port already being in use.

ImanMh commented 9 years ago

appreciate that. :thumbsup:

Port 3030 is already in use!
Please pick a different port (nws -p PORT) or kill the process using port 3030.