我有一個app4.js
與內容:永遠檢測腳本代碼退出:0
var express = require('express');
var app = express();
app.get('/', function (req, res) {
res.send('Hello World!');
});
app.listen(3000, function() {
console.log('Example app listening on port 3000!');
});
我在Win10 cmd
,我可以成功與node app4.js
運行它,並獲得Example app listening on port 3000!
,
但是當我使用forever -a forever.log start app4.js
,顯示錯誤
Forever detected script exited with code: 0
問題在哪裏?如何解決它?
CMD消息:
D:\app>node app4.js
Example app listening on port 3000!
^C
D:\app>forever -a forever.log start app4.js
warn: --minUptime not set. Defaulting to: 1000ms
warn: --spinSleepTime not set. Your script will exit if it does not stay up for at least 1000ms
error: Forever detected script exited with code: 0
Another Answer說這是關係到./bin/www
,但我不明白是什麼意思。