2017-04-14 107 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 

上一個應用程序實例仍在運行。只需重新啓動計算機或殺死相關的運行進程。