NodeJS - 本地范围已经关闭(致命错误)

时间:2012-02-29 06:47:23

标签: javascript node.js socket.io v8 npm

当我运行我的节点应用程序时,我在退出之前收到此错误消息:

  

致命错误:v8 :: HandleScope :: Close()本地范围已经关闭

通过搜索谷歌群组,我的一个理论是我有一个节点模块版本冲突。但我不确定如何解决它。

注意:我在这台机器上运行了另一个socket.IO服务器。这可能是罪魁祸首吗?

(function () {
    "use strict";

    var express = require("express");

    var app = module.exports = express.createServer(),
        util = require("util"),
        socketIO = require("socket.io"),
        connect = require("connect"),
        Room = require("./rooms/models").Room,
        User = require("./users/models").User,
        Abuse = require("./abusers/models").Abuse,
        guid = require("./utils").guid,
        forceLatency = require("./utils").forceLatency,
        latencyWrap = require("./utils").latencyWrap,
        config = require("./config"),
        log = require("./log"),
        mergeStatic = require("./mergeStatic"),
        geoip = require("geoip"),
        httpdigest = require('http-digest'),
        authServer = require('./authentication/server').authServer(),
        feedbackServer = require('./feedback/server').feedbackServer(),
        dnode = require("dnode");



    var registerAppRoutes = function(app) {
      //code code code
    }

    function registerSocketIO(app) {
        // code code code

    }

    mergeStatic(function (jsHash, cssHash) {

        app.helpers({
            jsHash: jsHash,
            cssHash: cssHash
        });

        registerAppRoutes(app);
        registerSocketIO(app);

        app.listen(config.port);        
        util.puts("Server started on port " + config.port);                

    });


}());

1 个答案:

答案 0 :(得分:0)

好的,所以我的预感是正确的。我用rm -rf清除了我的node_modules目录并运行了“node app.js”然后“npm install modulename”一遍又一遍,直到我的所有依赖项都被修复了。等不及节点演变出一个很棒的依赖管理解决方案!

现在一切正常。