2017-04-14 101 views
0

我试图在使用Git Bash的nodejs应用程序的调试模式下运行。 我做了几次,但在最近的它不工作了。应用程序在nodemon中崩溃

当我运行命令:

npm run startwindows:inspect 

它说:

14 Apr 15:10:59 - [nodemon] v1.4.1 
14 Apr 15:10:59 - [nodemon] to restart at any time, enter `rs` 
14 Apr 15:10:59 - [nodemon] ignoring: C:\XXX\.git/**/* C:\XXX\node_modules/**/* C:\XXX\bower_components/**/* .sass-cache 
14 Apr 15:10:59 - [nodemon] watching: C:\XXX\server/**/* C:\XXX\config-local/**/* 
14 Apr 15:10:59 - [nodemon] watching extensions: js,json,yaml 
14 Apr 15:10:59 - [nodemon] starting `node --inspect --debug-brk energyreports.js` 
14 Apr 15:10:59 - [nodemon] child pid: 6352 
Unable to open devtools socket: address already in use 
14 Apr 15:10:59 - [nodemon] app crashed - waiting for file changes before starting... 
14 Apr 15:11:03 - [nodemon] watching 37,149 files 
14 Apr 15:11:03 - [nodemon] watching 37,149 files - this might cause high cpu usage. To reduce use "--watch". 

我能提供更多的是startwindows:inspect距离的package.json文件的脚本,它看起来是这样的:

"startwindows:inspect":"set NODE_ENV=dus&& set NODE_CONFIG_DIR=./config-local/&& nodemon -V -w server -w config-local -e js,json,yaml --inspect --debug-brk| bunyan -o short" 

用什么方法使用--watch?在调试中测试它时,这是正常情况吗?我的CPU使用率一直很好。

回答

1

那么它说的确切是什么问题。

Unable to open devtools socket: address already in use 

上一个应用程序实例仍在运行。只需重新启动计算机或杀死相关的运行进程。