11

Got the following error starting Express node:

openssl config failed: error:02001003:system library:fopen:No such process

The node start anyway. I am not attempting to use SSL.

Here the starting code:

...
app = Express;
app.set('port', process.env.PORT || config.port);
try {

    var server = app.listen(app.get('port'), function () {
        console.log('Express server listening on port ' + server.address().address + ':' + server.address().port);
    });
} catch (e) {
    log.fatal(e);
}

Only happens on deploy server. Running in developer machine starts ok.

MiguelSlv
  • 14,067
  • 15
  • 102
  • 169

3 Answers3

23

The problem was that Express looks for the environment variable OPENSSL_CONF to lookup to SSL configuration file.

The variable OPENSSL_CONF was pointing to a non existence location on the drive. I removed from the system and the message disappear.

Note: must use a new console to launch the node so environment variable OPENSSL_CONF is not present. Or simple deleted on the current console.

Additional information at github

MiguelSlv
  • 14,067
  • 15
  • 102
  • 169
8

Removing global environment variable OPENSSL_CONF (leftover from previous troubleshooting) solved my problem.

Running on Windows you might try:

Set environment in local command window and verify problem:

set OPENSSL_CONF=c:\dummy  
npm -v

=> you now probably see this ssl error message

Remove environment and verify problem is gone:

set OPENSSL_CONF=
npm -v

=> no ssl error message

Source: https://github.com/npm/npm/issues/17261

Ahsan Ahmed
  • 327
  • 5
  • 13
4

Please check the System Variables and confirm if the location of openssl.cnf file listed there is correct. Cross check it and update the location in System Variables. Sys variable image