本文介绍了启动Node.js时出错:openssl配置失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

启动Express节点时出现以下错误:

Got the following error starting Express node:

该节点仍将启动.我不尝试使用SSL.

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

以下是起始代码:

...
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.

推荐答案

问题是Express会寻找环境变量OPENSSL_CONF来查找SSL配置文件.

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

变量OPENSSL_CONF指向驱动器上的不存在位置.我从系统中删除,消息消失了.

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

注意:必须使用新控制台启动节点,以便不存在环境变量OPENSSL_CONF.或在当前控制台上简单删除.

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.

其他信息,位于 github

这篇关于启动Node.js时出错:openssl配置失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-02 04:36