Tag: 节点检查

节点catch()错误不显示文件错误发生

我在节点中使用new –inspect参数来使用Chrome Developer Tools来debugging我的应用程序。 在我的承诺链的最后,我有一个非常基本的问题,但是返回的错误没有清楚地显示它们来自哪里。 我能看到错误发生在哪个文件? leagues(app).getLeagues(passData) .then(teamsApi.getNorsemenTeams) .then(filterBarGamesIndex) .then(gamesApi.getNorseGames) .then(gamesApi.getFilteredTeams) .then(function (passData) { res.render('games', { title: 'Results', passData: passData, type: req.originalUrl.split('/')[2] }) }) .catch(function(err) { console.error(err); //Line 35 }); } 而直接从控制台的错误是: TypeError: Cannot read property 'Intermediate_Division_2' of undefined at /var/www/beta.norsemanfc.co.uk/app/controllers/filterBar/fixturesIndex.js:27:62 at Array.filter (native) at module.exports (/var/www/beta.norsemanfc.co.uk/app/controllers/filterBar/fixturesIndex.js:25:42) at process._tickCallback (internal/process/next_tick.js:103:7)

Node-Inspector无法打开Chrome浏览器抛出错误ENOENT

我想知道为什么当我尝试使用节点检查器来debugging节点应用程序时出现以下错误。 在端口5858上侦听的debugging器events.js:154 throw er; //未处理的“错误”事件 Error: spawn C:\Users\Dell\AppData\Local\Google\Chrome\Application\Chrome.exe ENOENT at exports._errnoException (util.js:890:11) at Process.ChildProcess._handle.inexit(internal/child_process.js:182:32) at onErrorNT (internal/child_process.js:348:16) at _combinedTickCallback (node.js:383:13) at process._tickCallback (node.js:407:11) 我相信这个错误类似于https://github.com/node-inspector/node-inspector/issues/732报告的错误。 但是,我没有得到new_chrome.exe。 任何帮助表示赞赏 节点版本是5.9.1节点debugging版本是0.12.7 编辑:其实问题是chrome.exe文件是“程序文件(86)”,但运行节点debugging时它正在用户文件夹中search。 所以这是与节点模块浏览器启动当我运行detect.js,在browser-launcher2 / examples,它返回我正确的chrome.exepath,但是当我运行launch.js,它是返回给我的上面的错误,因为它试图find用户文件夹内的chrome.exe。 对此有何想法? 更新:添加临时解决scheme。 它为我工作。 注:这是一个临时解决scheme。 我正在保持这个问题的公开,以便为这个错误得到一个永久的解决scheme。 快乐编码:)

“node-debug index.js”和“run node-inspector,then node –debug index.js”有什么区别?

我尝试使用节点检查器来debugging我的节点应用程序。 起初,我用 node-debug index.js 但检查员不会停止在debugger语句,也无法设置断点。 但是,如果我跑 node-inspector 然后用debugging标志运行节点 node –debug index.js 检查员的工作就像一个魅力。 那么这两者有什么区别呢? 我尝试阅读https://github.com/node-inspector/node-inspector/blob/master/bin/node-debug.js但坦率地不明白:O 非常感谢你! 我使用的是mac osx 10.10.2

当我刷新应用程序时,节点检查器不会停在断点处

我一直在尝试使用节点检查器在节点中进行debugging。 但是,它只在我启动我的应用程序(npm start)时才起作用,然后在单独的terminal选项卡中input(node-debug app.js)。 一旦我设置了断点并在Chrome浏览器中刷新应用程序,debugging器就不会停在断点处。 在我的浏览器中,我在一个选项卡( http://127.0.0.1:8080/?port=5858 )中有节点检查器,在另一个选项卡(localhost:3000)中有我的应用程序。 我也尝试添加“debugging器” 代码如下所示,也没有与节点检查工作。 /* GET home page. */ router.get('/', function(req, res, next) { debugger; res.render('index', { title: 'Express' }); }); 任何想法将不胜感激!

Chrome控制台不适用于节点检查器浏览器UI中的variables。 如何启用?

重现步骤。 文件名是index.js及其内容: 'use strict'; debugger; let a = 10; // doesn't mean anything in regards to the issue. 针对该文件运行node-debug 。 $ node-debug index.js Node Inspector v0.12.8 Visit http://127.0.0.1:8080/?port=5858 to start debugging. Debugging `index.js` Debugger listening on [::]:5858 它会在Chrome中打开UI,并在debugger线上停止执行。 在“ Watch Expression部分中设置监视variablesprocess 。 在这里可以很容易地检查它。 但只有在这里, Watch Expression部分。 现在尝试在控制台中检查processvariables。 它不起作用。 您可以键入一个variables,但按[Enter]键不会显示processvariables。 它只是增加了新的一行: 这是什么行为? 如何使其工作?

使用node-inspector或babel-node-debugdebugginges6传输的代码

当我debugging我的节点restAPI时,我尝试使用节点检查器 node-inspector node –debug server.js 这样我可以debugging我的API使用本地主机:3000 / api …如果我使用节点debugging,没有办法。 它不会启动3000端口。 不过我的代码是ES6,所以在我目前的debugging中,我的代码是由Babel转译的。 我试过使用babel-node-debug,但是看起来也是和node-debug一样的情况。 我可以看到ES6代码,但是我不能通过端口3000进行debugging。 任何解决方法?

无法使节点debugging工作

这感觉真的很愚蠢,但我不能让节点检查器/ node-debug工作。 这些指令说要做npm install,然后运行node-debug web.js 所以我做到了。 现在我有一个可爱的浏览器窗口打开,显示了我的断点代码…并且不知道要使用哪个url来访问代码。 检查员在http://localhost:8080/debug?port=5858 ,terminal说: > node-debug web.js debugger listening on port 5858 Node Inspector is now available from http://localhost:8080/debug?port=5858 Debugging `web.js` … 我尝试点击localhost:5000 (这是我的express.js端口),但是,如果我没有一个单独的node web.js实例运行失败,或者它成功,如果我有另一个运行,但doesn'不要在检查员的任何一个断点处 当我去http://localhost:5858/ ,我得到: 远程debugging会话已经激活 当我去http://localhost:8080/ ,我得到: 不能获取 / ( /path一般在我的服务器上工作。)