Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge Debugging Guide and Inspector Help #1610

Merged
merged 1 commit into from
Apr 2, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions locale/en/docs/guides/debugging-getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,16 @@ info on these follows:
* **Option 3**: Install the Chrome Extension NIM (Node Inspector Manager):
https://chrome.google.com/webstore/detail/nim-node-inspector-manage/gnhhdgbaldcilmgcpfddgdbkhjohddkj

#### [VS Code](https://github.com/microsoft/vscode) 1.10+
#### [Visual Studio Code](https://github.com/microsoft/vscode) 1.10+

* In the Debug panel, click the settings icon to open `.vscode/launch.json`.
Select "Node.js" for initial setup.

#### [Visual Studio](https://github.com/Microsoft/nodejstools) 2017

* Choose "Debug > Start Debugging" from the menu or hit F5.
* [Detailed instructions](https://github.com/Microsoft/nodejstools/wiki/Debugging).

#### [JetBrains WebStorm](https://www.jetbrains.com/webstorm/) 2017.1+ and other JetBrains IDEs

* Create a new Node.js debug configuration and hit Debug. `--inspect` will be used
Expand All @@ -91,7 +96,7 @@ info on these follows:

The following table lists the impact of various runtime flags on debugging:

<table cellpadding=0 cellspacing=0>
<table cellpadding="0" cellspacing="0">
<tr><th>Flag</th><th>Meaning</th></tr>
<tr>
<td>--inspect</td>
Expand Down Expand Up @@ -142,6 +147,16 @@ The following table lists the impact of various runtime flags on debugging:
</ul>
</td>
</tr>
<tr>
<td><code>node inspect --port=xxxx <i>script.js</i></code></td>
<td>
<ul>
<li>Spawn child process to run user's script under --inspect flag;
and use main process to run CLI debugger.</li>
<li>Listen on port <i>port</i> (default: 9229)</li>
</ul>
</td>
</tr>
</table>

---
Expand Down
116 changes: 1 addition & 115 deletions locale/en/docs/inspector.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,118 +5,4 @@ layout: docs.hbs

# Debugging Node.js Apps

Many tools and libraries are available to help you debug your Node.js apps. Some
of these are listed below.

To connect manually rather than with a tool, pass the **--inspect** flag and
connect to the printed URL.

If a process was started without `--inspect`, signal it with SIGUSR1 to
activate the debugger and print the connection URL.

---

## Inspector Tools & Clients

These commercial and open source tools make debugging Node.js apps easier.

### [node-inspect](https://github.com/nodejs/node-inspect)

* A CLI debugger developed at <https://github.com/nodejs/node-inspect>.
* Bundled with Node and invoked with `node inspect myscript.js`.
* Can also be installed independently with `npm install -g node-inspect`
and invoked with `node-inspect myscript.js`.

### [Chrome DevTools](https://github.com/ChromeDevTools/devtools-frontend)

* **Option 1**: Open `chrome://inspect` in a Chromium-based
browser. Click the "Open dedicated DevTools for Node" link.
* **Option 2**: Install the Chrome Extension NIM (Node Inspector Manager):
https://chrome.google.com/webstore/detail/nim-node-inspector-manage/gnhhdgbaldcilmgcpfddgdbkhjohddkj

### [VS Code](https://github.com/microsoft/vscode) 1.10+

* In the Debug panel, click the settings icon to open `.vscode/launch.json`.
Select "Node.js" for initial setup.

### [Visual Studio](https://github.com/Microsoft/nodejstools)

* Choose "Debug > Start Debugging" from the menu or hit F5.
* [Detailed instructions](https://github.com/Microsoft/nodejstools/wiki/Debugging).

### [JetBrains WebStorm](https://www.jetbrains.com/webstorm/) 2017.1+ and other JetBrains IDEs

* Create a new Node.js debug configuration and hit Debug.

### [chrome-remote-interface](https://github.com/cyrus-and/chrome-remote-interface)

* Library to ease connections to Inspector Protocol endpoints.

---

## Command-line options

The following table lists the impact of various runtime flags on debugging:

<table cellpadding=0 cellspacing=0>
<tr><th>Flag</th><th>Meaning</th></tr>
<tr>
<td>--inspect</td>
<td>
<ul>
<li>Enable inspector agent</li>
<li>Listen on default address and port (127.0.0.1:9229)</li>
</ul>
</td>
</tr>
<tr>
<td>--inspect=<i>[host:port]</i></td>
<td>
<ul>
<li>Enable inspector agent</li>
<li>Bind to address or hostname <i>host</i> (default: 127.0.0.1)</li>
<li>Listen on port <i>port</i> (default: 9229)</li>
</ul>
</td>
</tr>
<tr>
<td>--inspect-brk</td>
<td>
<ul>
<li>Enable inspector agent</li>
<li>Listen on default address and port (127.0.0.1:9229)</li>
<li>Break before user code starts</li>
</ul>
</td>
</tr>
<tr>
<td>--inspect-brk=<i>[host:port]</i></td>
<td>
<ul>
<li>Enable inspector agent</li>
<li>Bind to address or hostname <i>host</i> (default: 127.0.0.1)</li>
<li>Listen on port <i>port</i> (default: 9229)</li>
<li>Break before user code starts</li>
</ul>
</td>
</tr>
<tr>
<td><code>node inspect <i>script.js</i></code></td>
<td>
<ul>
<li>Spawn child process to run user's script under --inspect flag;
and use main process to run CLI debugger.</li>
</ul>
</td>
</tr>
<tr>
<td><code>node inspect --port=xxxx <i>script.js</i></code></td>
<td>
<ul>
<li>Spawn child process to run user's script under --inspect flag;
and use main process to run CLI debugger.</li>
<li>Listen on port <i>port</i> (default: 9229)</li>
</ul>
</td>
</tr>
</table>
Page has been moved to [Guides: Debugging - Getting Started](./guides/debugging-getting-started/).
4 changes: 0 additions & 4 deletions locale/en/site.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,6 @@
"link": "docs/es6",
"text": "ES6 and beyond"
},
"inspector": {
"link": "docs/inspector",
"text": "Inspector"
},
"api-lts": {
"link": "/dist/latest-%ver-major%/docs/api",
"subtext": "LTS",
Expand Down