简体   繁体   English

Webstorm:调试node.js sails app

[英]Webstorm: debugging node.js sails app

I'm having a hard time finding the right combination of settings to allow me to debug my node.js sails application in webstorm. 我很难找到合适的设置组合,以便在webstorm中调试我的node.js sails应用程序。

These are the settings I've tried using, both configurations work (as in sails starts) but none is stopping at breakpoints. 这些是我尝试过的设置,两种配置都有效(如在风帆启动时),但没有一种在断点处停止。

在此输入图像描述

在此输入图像描述

If I go to the breakpoints menu and turn on 'Any exception enabled' - it does stop for exceptions, but never hits my breakpoints. 如果我转到断点菜单并启用“启用任何异常” - 它会停止异常,但永远不会触及我的断点。

Any ideas? 有任何想法吗? I'm on webstorm 7.0.1 and Node 0.10.18 / Sails 0.9.7 我在webstorm 7.0.1和Node 0.10.18 / Sails 0.9.7上

You don't need the --debug in node parameters. 您不需要节点参数中的--debug。 Here is my config and i am on 7.0.1 and node 0.10.4 这是我的配置,我在7.0.1和节点0.10.4

在此输入图像描述

Let me know if it helped. 如果有帮助,请告诉我。 Also, you are hitting the bug to run debug right? 此外,您正在尝试运行调试的错误吗? 在此输入图像描述

Also, can you please invalidate caches/ restart? 另外,你能否使缓存/重启无效? That helps sometimes. 这有时有帮助。 Here is a snapshot in the file menu. 这是文件菜单中的快照。 在此输入图像描述

I had the same problem and simply installed sails local to the project and everything worked fine. 我有同样的问题,只是在项目本地安装了帆,一切正常。 Not sure why the configuration can't resolve the globally installed sails as that is the error I was getting, but the local install works fine. 不知道为什么配置无法解析全局安装的风帆,因为这是我得到的错误,但本地安装工作正常。 I should investigate further, but I'm lazy :) 我应该进一步调查,但我很懒:)

When you open a new project on WebStorm, it detects the package.json file and it will ask you to install the dependencies locally. 当您在WebStorm上打开一个新项目时,它会检测到package.json文件,并会要求您在本地安装依赖项。 After that, by using the configuration mentioned before (not necessarily by using sails lift but using app.js directly instead), you can debug you application from WebStorm. 之后,通过使用前面提到的配置(不一定使用sails lift,而是直接使用app.js),您可以从WebStorm调试应用程序。 Another way to do it, is by using this tool, that works like a charm: https://github.com/node-inspector/node-inspector :) 另一种方法是使用这个工具,它就像一个魅力: https//github.com/node-inspector/node-inspector :)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM