gpt4 book ai didi

node.js - 快速调试 "cannot find stack"

转载 作者:搜寻专家 更新时间:2023-10-31 23:00:43 25 4
gpt4 key购买 nike

我正在尝试分析一个简单的快速应用程序。当我运行 Node 时,它以

响应
throw new Error('Cannot find stack');
^
Error: Cannot find stack

这是代码

var express = require("express");
var app = express();
require('express-debug')(app, {});
app.get("/", function(request, response) {
response.send("Hello world!");
});
app.get("/other", function(request, response) {
var message = "";
for(var ii = 0; ii < 10000; ++ii) {
message = message + "x";
}
response.send(message);
});
app.listen(3000);

最佳答案

要解决您的问题,您必须在路由后调用 express-debug,例如:

var express = require("express");
var app = express();
var debug = require('express-debug')
app.get("/", function(request, response) {
response.send("Hello world!");
});
app.get("/other", function(request, response) {
var message = "";
for(var ii = 0; ii < 10000; ++ii) {
message = message + "x";
}
response.send(message);
});

debug(app, {});
app.listen(3000);

关于node.js - 快速调试 "cannot find stack",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28517914/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com