本文介绍了Mean.io应用程序永远抛出错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在研究一个mean.io应用程序。我试图在Ubuntu shell上运行这个应用程序,并使用永久模块的节点,但它抛出一个错误。
util.js: 756
抛出新的TypeError('继承`的超级构造函数不能'+
^:`继承`的超级构造函数不能为null或未定义
在Object.exports。在Object处继承(util.js:756:11)
。< anonymous>(/usr/lib/node_modules/forever/node_modules/forever-monitor/lib/forever-monitor/monitor.js:142:7 )在Module._compile(module.js:435:26)
在Object.Module._extensions..js(module.js:442:10)
在Module.load(module .js:356:32)
at Function.Module._load(module.js:311:12)
at Module.require(module.js:366:17)
at require module.js:385:17)
at Object。< anonymous>(/usr/lib/node_modules/forever/node_modules/forever-monitor/lib/index.js:14:24)
at Module._compile(module.js:435:26)
任何人都可以帮助解决这个问题起诉,我该如何解决这个错误。
解决方案
我面临同样的问题。这是由于使用Redistore和express参数。
$ $ $ $ $ $ var RedisStore = require('connect-redis')(express);
最后,我使用会话作为参数来修复它。
var session = require('express-session');
var RedisStore = require('connect-redis')(session);
希望它对您有所帮助。
I am working on a mean.io application. I am trying to run this application on Ubuntu shell with forever module of node but it is throwing an error
"util.js:756
throw new TypeError('The super constructor to `inherits` must not ' +
^: The super constructor to `inherits` must not be null or undefined.
at Object.exports.inherits (util.js:756:11)
at Object.<anonymous> (/usr/lib/node_modules/forever/node_modules/forever-monitor/lib/forever-monitor/monitor.js:142:7)
at Module._compile (module.js:435:26)
at Object.Module._extensions..js (module.js:442:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:311:12)
at Module.require (module.js:366:17)
at require (module.js:385:17)
at Object.<anonymous> (/usr/lib/node_modules/forever/node_modules/forever-monitor/lib/index.js:14:24)
at Module._compile (module.js:435:26)
"
Can anyone help on this what is the actual issue,how i can resolve this error.
解决方案
I have faced the same issue. It was due to using Redistore with "express" parameter
var RedisStore = require('connect-redis')(express);
finally I fixed it using a session as parameter.
var session = require('express-session');
var RedisStore = require('connect-redis')(session);
Hope it helps you.
这篇关于Mean.io应用程序永远抛出错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!