節點能夠通過調試參數這樣如何將參數傳遞給nodemon(或node-supervisor)中的可執行文件?
$ node --debug src/file.js
運行我也可以傳遞參數通過咖啡腳本二進制這樣
$ coffee --nodejs --debug src/file.coffee
其中一期工程。但是當我涉及supervisor時事情變得更加困難。運行腳本咖啡是沒有問題的:
$ supervisor -w src src/file.coffee
但我想調試我與supervisor運行咖啡腳本。我如何發送參數如--debug
到supervisor?我試圖可執行與參數這樣設置的字符串:
$ supervisor -w src -x "coffee --nodejs --debug" src/server.coffee
其中產生一個無限重複錯誤消息,
DEBUG: Starting child process with 'coffee --nodejs --debug src/server.coffee' DEBUG: execvp(): No such file or directory
哪個是奇數,因爲在終端運行coffee --nodejs --debug src/server.coffee
作品。
那麼如何通過supervisor發送參數?
編輯:我想擴大我的問題與提的是,我現在已經使用nodemon也試過。這似乎nodemon優選考慮node-supervisor,所以我會接受,說明任何回答如何通過nodemon
推出咖啡腳本時傳遞--debug
到節點過程
編輯:下面是從nodemon輸出。顯然,參數不以相同的順序傳遞:-(
$ nodemon -w src -x coffee --nodejs --debug src/server.coffee 15 Jan 03:41:56 - [nodemon] v0.6.5 15 Jan 03:41:56 - [nodemon] watching: /foo/bar/server/src 15 Jan 03:41:56 - [nodemon] running --debug 15 Jan 03:41:56 - [nodemon] starting `coffee --debug --nodejs src/server.coffee` node.js:201 throw e; // process.nextTick error, or 'error' event on first tick ^ Error: unrecognized option: --debug
新來這裏的節點。關於爲什麼nodemon比主管更可取的任何細節?我注意到的一件事是,在發生崩潰之後,再也沒有瘋狂的嘗試。 – 2012-09-16 20:08:34