Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/codeigniter/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
node.js模块中存在未定义的错误_Node.js - Fatal编程技术网

node.js模块中存在未定义的错误

node.js模块中存在未定义的错误,node.js,Node.js,我是node.js的新手。我必须运行一个现有的应用程序。当我运行应用程序时,我得到了以下代码的未定义变量。有什么不对劲 var i18n = require("i18n"); module.exports = function(app, express){ var config = this; // "this" is undefined, so I get config undefined which is causing problem ahead. app.configur

我是node.js的新手。我必须运行一个现有的应用程序。当我运行应用程序时,我得到了以下代码的未定义变量。有什么不对劲

var i18n = require("i18n");

module.exports = function(app, express){

var config = this; // "this" is undefined, so I get config undefined which is causing problem ahead.


    app.configure(function(){
       ...
       ...
    });


   .....
   .....

    return config;

};

您如何调用模块函数?@numbers1311407,在app.js中,我有以下代码来调用模块<代码>var express=require('express')、loader=require('./loader')、testHelper、testData;var app=module.exports=express();var config=require('./config.js')(app,express);loader.loadConfig(app)你可能想看看,没有双关语。以您现在的方式调用函数时,
未定义此