I'm trying to integrate google maps into my react native app I keep getting this error.
events.js:183
throw er; // Unhandled 'error' event
^
Error: listen EADDRINUSE :::8081
at Server.setupListenHandle [as _listen2] (net.js:1360:14)
at listenInCluster (net.js:1401:12)
at Server.listen (net.js:1485:7)
at C:\projects\test\node_modules\metro\src\index.js:205:18
at new Promise (<anonymous>)
at Object.<anonymous> (C:\projects\test\node_modules\metro\src\index.js:204:12)
at Generator.next (<anonymous>)
at step (C:\projects\testnode_modules\metro\src\index.js:58:30)
at C:\projects\test\node_modules\metro\src\index.js:69:15
at <anonymous>
Assuming you are using Linux.
It seems that your process is locked. In a terminal type the following:
ps -aux | grep '8081
copy the process ID
type in the terminal
sudo kill -9 ID-HERE replace ID-HERE with the process ID.
Restart the application.
If you are using Windows
type Ctrl+SHIFT+Esc to open the process window
Look for your process
Right click on the process and choose end process
Restart the application
Related
error listen eaddrinuse: address already in use :::8081
Error: listen EADDRINUSE: address already in use :::8081
at Server.setupListenHandle [as _listen2] (node:net:1372:16)
at listenInCluster (node:net:1420:12)
at Server.listen (node:net:1508:7)
at D:\RND\Mobile\node_modules\metro\src\index.js:164:16
at new Promise (<anonymous>)
at Object.exports.runServer (D:\RND\Mobile\node_modules\metro\src\index.js:163:10)
at async Object.runServer [as func] (D:\RND\Mobile\node_modules\#react-native-community\cli-plugin-metro\build\commands\start\runServer.js:121:26)
at async Command.handleAction (D:\RND\Mobile\node_modules\#react-native-community\cli\build\index.js:192:9)
info Run CLI with --verbose flag for more details.
You have an active process on that port
You should either change the port or find and kill the active process
netstat -aon | find "8081"
and when you find the PID of the process you can do
taskkill /F /PID <PID>
I am new to NodeJS, I have a microservice running which I want to open a webpage without a browser, to make client side api requests every 20 seconds. I am attempting to use the package openurl
const openPage = require("openurl");
function openUpPage(url){
openPage.open(url);
}
setInterval(function() { openUpPage("myURl") }, 20000);
However I now keep getting the error:
events.js:183
throw er; // Unhandled 'error' event
Error: spawn xdg-open ENOENT
at _errnoException (util.js:1022:11)
at Process.ChildProcess._handle.onexit (
internal/child_process.js:190:19)
at onErrorNT (internal/child_process.js:372:16)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickCallback (internal/process/next_tick.js:180:9)
events.js:160
throw er; // Unhandled 'error' event
^
Error: Cannot find module 'generator-ng-component/generators/route'
at Function.Module._resolveFilename (module.js:470:15)
at Function.resolve (internal/module.js:27:19)
at child.compose (/usr/local/lib/node_modules/generator-angular-fullstack/generators/route/index.js:7:92)
at Object.<anonymous> (/usr/local/lib/node_modules/generator-angular-fullstack/node_modules/yeoman-generator/lib/base.js:439:23)
at /usr/local/lib/node_modules/generator-angular-fullstack/node_modules/yeoman-generator/node_modules/run-async/index.js:25:25
at /usr/local/lib/node_modules/generator-angular-fullstack/node_modules/yeoman-generator/node_modules/run-async/index.js:24:19
at /usr/local/lib/node_modules/generator-angular-fullstack/node_modules/yeoman-generator/lib/base.js:440:9
at runCallback (timers.js:649:20)
at tryOnImmediate (timers.js:622:5)
at processImmediate [as _immediateCallback] (timers.js:594:5)
It is my guess that it's an issue with the angular-fullstack generators.
I have been encountering the same issue when performing the following command:
yo angular-fullstack:route [myroute]
angular-fullstack generators are now integrating Angular2, but may not be fully finished. For example, endpoints are working
yo angular-fullstack:enpoint [myendpoint]
I assume this because the code for generator-angular-fullstack/generators/endpoint or generator-angular-fullstack/generators/component look very different than generator-angular-fullstack/generators/route.
Unfortunately, this isn't a solution. If I am correct, I guess we can either wait for an update or create new routes manually for now.
EDIT: generator-angular-fullstack#5.0.0-alpha.3.
I'm getting this error when openssl child proccess is trying to write() to local directory.
Connection is closed before write() is called. It isn't connected with the ssl, because I can't even launch example code from nodejs documentation.
What am I missing? Some kind of special rights for nodejs?
Please, can anyone give me a real example how to use childProccess.stdin.write()?
events.js:85
throw er; // Unhandled 'error' event
^
Error: write EPIPE
at exports._errnoException (util.js:746:11)
at Socket._writeGeneric (net.js:690:26)
at Socket._write (net.js:709:8)
at doWrite (_stream_writable.js:301:12)
at writeOrBuffer (_stream_writable.js:288:5)
at Socket.Writable.write (_stream_writable.js:217:11)
at Socket.write (net.js:634:40)
at signManifest (...\node_modules\passbook\lib\pass.js:360:14)
It appeared that i've installed openssl in a wrong way. An error (wrong openssl directory) while execFile(openssl) emitted 'close' event, so write threw EPIPE.
Be careful and add a lot of proper error handlers :)
I'm using Linux Mint 14.
I've created the chatroom app described in "Node.js in action" Chapter 2. However the
chatServer.listen(server);
in server.js causes this error:
nodejs server.js
info - socket.io started
warn - error raised: Error: listen EACCES
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> (/home/andrew/Google Drive/AJRComp/Src/JavaScript/Node.js/NodejsInAction/chatrooms/server.js:55:8)
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 Function.Module.runMain (module.js:497:10)
Googling for this there does seem to be the same question asked on Mar 18, but it only comes up in the Google search, I can't seem to find it on the stackoverflow site (could it have been deleted).
The only solution I've found to do with this error using socket.io is to do with having to run as root if the port numbers are less than 1024, but I'm listening on 3000.
Using nmap localhost, port 3001 is reported as open and used by the nessus service. But I don't seem to have Nessus installed. So could there be some kind of port protection that's stopping my app listening on that port??
Thanks in advance.
Error: listen EADDRINUSE
This mean Error Address already in use. There is something else running on same port where you want to want the nodejs server.
lsof -i:<port>
will give you the information regarding the process running on the port.
I finally managed to track this down (on Cloud9, I didn't go back and try it on localhost). I used
$ fuser 3000/tcp
to check if that port was used, and then
$ fuser -k 3000/tcp
to close that process.
(And as an aside I had to update the jquery file used to the latest version to get the chat app to actually work).