1. 程式人生 > >如何調試Node.js

如何調試Node.js

rom href cto chrome瀏覽器 技術分享 mage CA title listen

Debugging Node.js with Chrome DevTools

https://nodejs.org/en/docs/guides/debugging-getting-started/

1.

PS C:\Users\clu\Documents\NodeApp\Test> node --inspect .\app.js
Debugger listening on ws://127.0.0.1:9229/34c03922-857b-4e6d-82cf-30dbf27a76ff
For help, see: https://nodejs.org/en/docs/inspector
Server running at http://127.0.0.1:3000/

2.在Chrome瀏覽器中打開about:inspect

技術分享圖片

3.打開 Click the Open dedicated DevTools for Node link.

技術分享圖片

在vs2017中調試

https://github.com/Microsoft/nodejstools/wiki/Debugging

創建Node.js項目,https://github.com/Microsoft/nodejstools/wiki/Projects

debug設置,https://github.com/Microsoft/nodejstools/wiki/Debugging#debugging-options

Developer Tools in Chrome(Chrome Extension)

https://chrome.google.com/webstore/detail/nodejs-v8-inspector-manag/gnhhdgbaldcilmgcpfddgdbkhjohddkj

如何調試Node.js