Magic Mirror app cannot launch with webcam running
I need help with configuring either my Webcam Motion software or the Magic Mirror app. The issue I am facing is that after installing the webcam server software Motion, whenever I try to run my Magic Mirror app from its directory, I encounter this error.
Error: listen EADDRINUSE 127.0.0.1:8081
at Object.exports._errnoException (util.js:1050:11)
at exports._exceptionWithHostPort (util.js:1073:20)
at Server.setupListenHandle [as _listen2] (net.js:1263:14)
at listenInCluster (net.js:1304:12)
at doListen (net.js:1428:7)
at GetAddrInfoReqWrap.asyncCallback [as callback] (dns.js:62:16)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:78:10)
All other modules are always working but this error will occur at the end of the code and then my webcam’s Live Stream will be displayed at the center of my screen.
To rectify this issue manually, I always have to enter sudo service motion stop before going to Magic Mirror directory and starting it. Only then will the Magic Mirror app run smoothly.
I hope that someone can advise me on what configuration I need to change in which file to avoid having this issue but yet have my webcam running when Magic Mirror is run.