在Webstorm中调试Node JS [英] Debug node js in webstorm
本文介绍了在Webstorm中调试Node JS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我花了很多时间来找出如何在Webstorm中调试简单的node.js文件。在node.js中编写简单的api后,
停留在某个地方并寻找可以逐行调试的解决方案。
我正在使用Web-storm编辑器。
如果找到某种方法,我也会提供帮助。
I spent lot of time to find out how I can debug simple node.js file in webstorm. after writing simple api in node.js I stuck at some place and looking for solution where i can debug line by line. I am using Web-storm editor. I will also contribute if find some way.
推荐答案
步骤调试节点JS代码
Steps to Debug Node JS code
- 打开控制台并键入node(它将打开节点外壳)
- 运行process.env
- 复制PATH值的内容
- 将环境变量添加到名为PATH的Webstorm使用此值。它将覆盖Webstorm为您的应用提供的默认PATH变量。
- Open console and type node(it will open node shell).
- Run process.env
- Copy the contents of the PATH value
- Add an environment variable to Webstorm called PATH that uses this value. It will overwrite the default PATH variable that Webstorm gives your app.
如何添加
- 单击右上角的文件名。 >
- 单击编辑配置,然后单击环境变量。
- 单击+按钮,然后粘贴PATH变量值的值。
在此处输入图片描述
- Click on file name on right top corner.
- Click on Edit configuration and click Environment Variables.
- Click on + button and paste value of PATH variable value. enter image description here
- 单击Webstrom
上的调试按钮(它等于我们在控制台上运行的节点filename.js)。
在此处输入图片描述
- click on debug button on Webstrom (it equal to node filename.js which we run on console). enter image description here
在代码中放置断点,并通过浏览器/ POSTMAN命中API。
这篇关于在Webstorm中调试Node JS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文