MiguelSlv
MiguelSlv

Reputation: 15103

Error starting nodejs: openssl config failed

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.

Upvotes: 11

Views: 27132

Answers (3)

Asish Sinha
Asish Sinha

Reputation: 61

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

Upvotes: 4

Ahsan Ahmed
Ahsan Ahmed

Reputation: 357

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

Upvotes: 10

MiguelSlv
MiguelSlv

Reputation: 15103

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

Upvotes: 24

Related Questions