我刚刚将Chrome升级到73.0.3683.75(Linux),现在无法让我的专用Node调试器实际调试正在运行的实例。即使我可以在控制台中看到“Debugger attached”消息:
$ node --inspect-brk hello.js
Debugger listening on ws://127.0.0.1:9229/864a1c18-5e45-49ab-843c-77a22841ffff
For help, see: https://nodejs.org/en/docs/inspector
Debugger attached.
任何人都知道如果Chrome 73中的这个被破坏或者我做错了什么?谢谢!
是的,这是v73的一个错误。我也看到了
https://bugs.chromium.org/p/chromium/issues/detail?id=941608&q=nodeJS
更新
此错误已在chrome 74.0.3729.61 check here中修复
您可以使用为node.js和GoogleChromeLabs定制的ndb。
安装使用
npm install -g ndb
用法:
使用ndb而不是node命令:
ndb server.js
# Alternatively, you can prepend `ndb`
ndb node server.js
在任何其他二进制文件前面添加ndb:
ndb npm run unit
ndb mocha
ndb npx mocha
将ndb作为独立应用程序启动:
# cd to your project folder (with a package.json)
ndb .
# In Sources panel > "NPM Scripts" sidebar, click the selected "Run" button
如果您使用nodemon:
ndb nodemon .
有关更多详细信息,请参阅项目github存储库