Unhandled promise rejection in Docker with 'opn' npm module

UnhandledPromiseRejectionWarning: Unhandled promise
rejection (rejection id: 1): Error: Exited with code 3

I apparently get this error when I open links using the module in Docker container. I tested the code in my local before I put the code on my server which uses Docker. And It literally works well in my local that doesn’t use Docker. So I assume that something is wrong with docker but there’s actually no way to figure out what the problem is. Is there anyone who has ever used ‘opn’ module with Docker?

app.use('/:encoded_id', function(req, res) {
let base58Id = req.params.encoded_id;
let id = base58.decode(base58Id)
Url.findOne({ _id:id }, function(err, doc) {
    if (err) console.error(err);
    if (doc) {
      opn(doc.long_url[i]);
     }
    else res.redirect(config.webhost);
 })
});

  • Beneifts of line continuation in Dockerfiles
  • How to retrieve the newest tag for an image?
  • (mac) dockers , how to connect to a redis server in the hosting machine from a containter
  • Docker container on Marathon doesn't finish
  • How to login local machine and change system parameter when use docker for mac [closed]
  • No response from Firebase in Docker
  • Docker daemon processes
  • Multiple RUN vs. single chained RUN in Dockerfile, what is better?
  • Django connection to postgres by docker-compose
  • Is it possible to create ipv4-enabled Docker Machine on Windows 10?
  • Docker - how to set up compose for local webserver
  • Can I run docker containers linked with different OS
  • One Solution collect form web for “Unhandled promise rejection in Docker with 'opn' npm module”

    Exit code 3 means that:

    A required tool could not be found.

    You say that the goal is to “open links”, so the Docker container probably does not have a browser (or at least a default browser, anyway).

    If you are sure that the required software is installed, it is probably a configuration issue. In this case, you can work around it by specifying the app option. But try to avoid using it if you can, as it is platform dependent and so will make your code less portable.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.