> For the complete documentation index, see [llms.txt](https://1425816423.gitbook.io/my-knowledge-base/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://1425816423.gitbook.io/my-knowledge-base/fu-wu-qi-duan/nodejs/nodejs-tiao-shi.md).

# Nodejs调试

tags: Nodejs Created time: July 21, 2022 4:30 PM emoji: <https://nodejs.org/static/images/favicons/favicon.png>

简单的Nodejs调试有两种方式

* VSCode调试工具
* Chrome调试工具

## VSCode调试

vscode调试nodejs很简单，直接按`F5`，选择Nodejs即可调试

## Chrome调试

用Chrome调试时，需要启用inspect参数，

```css
nodejs --inspect index.js
```

然后终端会打印debugger监听端口，在谷歌浏览器中打开

```css
chrome://inspect
```

点击inspect即可调试，调试窗口类似于浏览器开发者工具。
