javascript - Error: listen EADDRINUSE when running a Node.js script -


I get this error: listen to EADDRINUSE when I run the following code> simpleJSON. Js script:

  var http = need ('http'), fs = need ('fs'); Function handle_inings_request (rick, rask) {console.log ("incoming request: (" + req.method + ")" + req.url); Load_album_list (function (err, album) {if (err! = Null) {res.writeHead (503, {"content-type": "application / json"}) res.end (JSON.stringify ({error: ( "Content-type": "app / json"}; res.end (JSON.stringify ({@} error: empty, data: {album: album}}) + "\ n");});} function Load_album_list {call_back} {fs.readdir ('album /', function (error, file_list) {callback (err, file_list);})} var s = http.createServer (handle_incoming_request); s.listen (8080); < / Code> 

I see the full error in my terminal:

  $ node ordinary json.js events.js: 72for er; // unchecked 'error' Event ^ error: errnoExcepti on server._listen2 (net.js: 1042: 14) Listen (net.js: 1064: 10) on EADDRINUSE Listen to the server (net.js: 904: 11). Listen to the object (net.js: 1138: 5) & lt; anonymous & gt; (/ home / Module on Object / simpleJSON.js: 26: 3) on module._compile (module .js: 456: 26) module._extension .. module on js (module js: 474: 10) On the load (module.js: 356: 32) function. Function on module._load (module.js: 312: 12) Module.Rannman (Module Js: 497: 10)  

And here is my directory structure:

  $ tree ├── Album │ ├── Australia 2012 │ │ ├── photo_01. Jpg │ │ ├── picture_02.jpg │ │ ├── picture_03.jpg │ │ ├── picture_04.jpg │ │ ├── picture_05.jpg │ │ ├── picture_06.jpg │ │ └── picture_07.jpg │ ├── italy2012 │ │ ├── photo_01. Jpg │ │ ├── picture_02.jpg │ │ ├── picture_03.jpg │ │ ├── Picture_04 .jpg │ │ ├── picture_05.jpg │ │ ├── picture_06.jpg │ │ └── picture_07.jpg │ └── japan2010 │ ├── photo_01. Jpg │ ├── picture 0 _2 ├── picture 0 .jpg │ ├── picture_04.jpg │ ├── picture_05.jpg │ ├── picture_06.jpg │ └── picture_07.jpg └── simpleJSON.js 4 directories, 22 files  

Has worked before? It is possible that there is still a surviving process connected to Port 8080. Try changing the port number to see if this is a problem.


Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -