Mopidy js connect ECONNREFUSED 127.0.0.1:80

From the docs at Mopidy.js JavaScript library — Mopidy 3.4.2 documentation :

When you instantiate Mopidy() without arguments, it will connect to the WebSocket at /mopidy/ws/ on the current host. Thus, if you don’t host your web client using Mopidy’s web server, or if you use Mopidy.js from a Node.js environment, you’ll need to pass the URL to the WebSocket end point:

The error message states its trying to connect to mopidy at localhost/mopidy/ws. I would guess you don’t have a Mopidy server listening there on port 80. By default it’s at http://localhost:6680/mopidy/ws.