最近重新开始electron开发,两三年前写的代码几乎看不懂了。。然后debug一下,直接报错了:
Debugger listening on ws://127.0.0.1:20793/d146ffdb-c3b8-4480-a8d8-d04bb643c7c1
For help, see: https://nodejs.org/en/docs/inspector
Error in debuggerConnector: connect ECONNREFUSED ::1:20792
Error: connect ECONNREFUSED ::1:20792
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1555:16)
Debugger listening on ws://127.0.0.1:20797/a813ad62-fbcf-4d73-9168-4b4fcb966476
For help, see: https://nodejs.org/en/docs/inspector
Error in debuggerConnector: connect ECONNREFUSED ::1:20792
Error: connect ECONNREFUSED ::1:20792
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1555:16)
Debugger listening on ws://127.0.0.1:20806/b30363a0-541f-49a8-815d-316d80320ad8
For help, see: https://nodejs.org/en/docs/inspector
根本没法debug了。。。
网上各种搜索,各种折腾都用上了,都拿他没办法,后来想到跟node有关,而node版本我又换了n次。故直接使用nvm安装以前的旧版本。
nvm install 12.18.4
nvm use 12.18.4
node -v
npm -v
一番操作,debug又可以用了,非常棒!