Logging and error middleware
Some thoughts:


Consider making your middleware package into a proper (private?) npm package and consume it as such in the main application. This would also allow better reuse across other applications that may need this behavior.
const log = require('../../logger'); This relative reference seems problematic. I would guess your logger should also be a proper npm package (or in same package as your middleware if this is a custom logger).  At a very minimum, I would think you would want to use path or similar to get to an absolute file reference based on the location of your middleware file to the working directory.
Your methodology for determining 'production' environment seems fragile. Why is it up to your middleware package to have a hard-coded string in it that determines whether production behavior is to be expressed?
The deleteErrorStack() function seems superfluos and actually obfuscates the logic of what is happening in the handleErrors function.  Why not just have this single line of code inside the handleErrors function so intent is much clearer.


For example:

const handleErrors = () =&gt; {
  return (err, req, res, next) =&gt; {
    const statusCode = getStatusCode(err.statusCode);
    const errorContext = createErrorContext(statusCode);

    if(isProdEnv(req.app.get('env')) {
        delete err.stack;
    }
    res.status(statusCode).json(errorContext);
  };
};



One could possibly argue that the deletion of the stack trace information from err is logic this should exist within your context creation method, as this is really a display concern, not an error handling concern.