簡體   English   中英

sails debug命令在Sails.js中不起作用

[英]sails debug command not working in Sails.js

我正在創建我的第一個sails.js應用程序。 當我嘗試

sails debug

我在命令提示符下遇到以下錯誤

Debugger listening on port 5858
info: Starting app...

error: Grunt :: Error: listen EADDRINUSE
    at exports._errnoException (util.js:746:11)
    at Agent.Server._listen2 (net.js:1129:14)
    at listen (net.js:1155:10)
    at Agent.Server.listen (net.js:1240:5)
    at Object.start (_debugger_agent.js:20:9)
    at startup (node.js:86:9)
    at node.js:814:3

要使用端口:5858獲取進程的PID,我嘗試運行

C:\Windows\system32>netstat -a -n -o

但遺憾的是沒有進程到5858端口。我在這里遺漏了什么嗎?

我正在使用帶有node.js v0.12.0sails.js 0.11.0 Windows 8.1

我的服務器使用節點0.10.38與風帆,因為一些奇怪的不固定的咕嚕聲與11+。 暫時沒有解決這個問題,但看起來有新的活動... 特別查看這個評論 ,這解釋了問題和可能的修復(直接引用):

可能解決方案

查看child_process.fork的選項, - 退出子宮時將--debug標志傳遞給子進程,即運行sails debug:

 // ./node_modules/sails/bin/sails-debug.js // Spin up child process for Sails Womb.spawn('node', ['--debug', pathToSails, 'lift'], { stdio: 'inherit' }); 

將options.execArgv設置為空數組會刪除該標志並允許該進程繼續:

 // ./node_modules/sails/lib/hooks/grunt/index.js var child = ChildProcess.fork( path.join(__dirname, 'grunt-wrapper.js'), [ taskName, '--pathToSails='+pathToSails, '--gdsrc='+ pathToSails + '/node_modules' ], { silent: true, stdio: 'pipe', execArgv: [] } ); 

這似乎是Sails中的一個錯誤。 您可以通過替換Sails的文件來應用自我修復:

./node_modules/sails/lib/hooks/grunt/index.js

以下內容:

https://raw.githubusercontent.com/balderdashy/sails/88ffc0ed9949f8c74ea390efb5610b0e378fa02c/lib/hooks/grunt/index.js

這是Sails發布版本v12中的文件。

您是否嘗試像簡單node.js一樣在調試中運行?

node --debug app.js

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM