@@ -5,118 +5,4 @@ layout: docs.hbs
55
66# Debugging Node.js Apps
77
8- Many tools and libraries are available to help you debug your Node.js apps. Some
9- of these are listed below.
10-
11- To connect manually rather than with a tool, pass the ** --inspect** flag and
12- connect to the printed URL.
13-
14- If a process was started without ` --inspect ` , signal it with SIGUSR1 to
15- activate the debugger and print the connection URL.
16-
17- ---
18-
19- ## Inspector Tools & Clients
20-
21- These commercial and open source tools make debugging Node.js apps easier.
22-
23- ### [ node-inspect] ( https://github.com/nodejs/node-inspect )
24-
25- * A CLI debugger developed at < https://github.com/nodejs/node-inspect > .
26- * Bundled with Node and invoked with ` node inspect myscript.js ` .
27- * Can also be installed independently with ` npm install -g node-inspect `
28- and invoked with ` node-inspect myscript.js ` .
29-
30- ### [ Chrome DevTools] ( https://github.com/ChromeDevTools/devtools-frontend )
31-
32- * ** Option 1** : Open ` chrome://inspect ` in a Chromium-based
33- browser. Click the "Open dedicated DevTools for Node" link.
34- * ** Option 2** : Install the Chrome Extension NIM (Node Inspector Manager):
35- https://chrome.google.com/webstore/detail/nim-node-inspector-manage/gnhhdgbaldcilmgcpfddgdbkhjohddkj
36-
37- ### [ VS Code] ( https://github.com/microsoft/vscode ) 1.10+
38-
39- * In the Debug panel, click the settings icon to open ` .vscode/launch.json ` .
40- Select "Node.js" for initial setup.
41-
42- ### [ Visual Studio] ( https://github.com/Microsoft/nodejstools )
43-
44- * Choose "Debug > Start Debugging" from the menu or hit F5.
45- * [ Detailed instructions] ( https://github.com/Microsoft/nodejstools/wiki/Debugging ) .
46-
47- ### [ JetBrains WebStorm] ( https://www.jetbrains.com/webstorm/ ) 2017.1+ and other JetBrains IDEs
48-
49- * Create a new Node.js debug configuration and hit Debug.
50-
51- ### [ chrome-remote-interface] ( https://github.com/cyrus-and/chrome-remote-interface )
52-
53- * Library to ease connections to Inspector Protocol endpoints.
54-
55- ---
56-
57- ## Command-line options
58-
59- The following table lists the impact of various runtime flags on debugging:
60-
61- <table cellpadding =0 cellspacing =0 >
62- <tr ><th >Flag</th ><th >Meaning</th ></tr >
63- <tr >
64- <td>--inspect</td>
65- <td>
66- <ul>
67- <li>Enable inspector agent</li>
68- <li>Listen on default address and port (127.0.0.1:9229)</li>
69- </ul>
70- </td>
71- </tr >
72- <tr >
73- <td>--inspect=<i>[host:port]</i></td>
74- <td>
75- <ul>
76- <li>Enable inspector agent</li>
77- <li>Bind to address or hostname <i>host</i> (default: 127.0.0.1)</li>
78- <li>Listen on port <i>port</i> (default: 9229)</li>
79- </ul>
80- </td>
81- </tr >
82- <tr >
83- <td>--inspect-brk</td>
84- <td>
85- <ul>
86- <li>Enable inspector agent</li>
87- <li>Listen on default address and port (127.0.0.1:9229)</li>
88- <li>Break before user code starts</li>
89- </ul>
90- </td>
91- </tr >
92- <tr >
93- <td>--inspect-brk=<i>[host:port]</i></td>
94- <td>
95- <ul>
96- <li>Enable inspector agent</li>
97- <li>Bind to address or hostname <i>host</i> (default: 127.0.0.1)</li>
98- <li>Listen on port <i>port</i> (default: 9229)</li>
99- <li>Break before user code starts</li>
100- </ul>
101- </td>
102- </tr >
103- <tr >
104- <td><code>node inspect <i>script.js</i></code></td>
105- <td>
106- <ul>
107- <li>Spawn child process to run user's script under --inspect flag;
108- and use main process to run CLI debugger.</li>
109- </ul>
110- </td>
111- </tr >
112- <tr >
113- <td><code>node inspect --port=xxxx <i>script.js</i></code></td>
114- <td>
115- <ul>
116- <li>Spawn child process to run user's script under --inspect flag;
117- and use main process to run CLI debugger.</li>
118- <li>Listen on port <i>port</i> (default: 9229)</li>
119- </ul>
120- </td>
121- </tr >
122- </table >
8+ Page has been moved to [ Guides: Debugging - Getting Started] ( ./guides/debugging-getting-started/ ) .
0 commit comments