node.js - Forever-npm 不会启动我的 ExpressJS 应用程序

标签 node.js ubuntu express forever

我正在尝试永远使用,以便我可以确保我的 ExpressJS 应用程序将保持持续运行。

我使用的是 Ubuntu 14.04 LTS。

奇怪的是,'forever list' 不显示任何内容,'forever --version' 不显示任何内容

我已经尝试过:

forever start -c "npm start" ./

和:

forever start app.js

没有任何显示。

最佳答案

如果您将 Node js 与 Express 框架一起使用,则脚本将不会开始使用:

forever start app.js

首先停止所有正在运行的应用程序:

forever stopall

当使用此 Express 框架时,必须以以下方式启动:

forever start ./bin/www

您应该在 package.json 文件中找到它:

"scripts": {
    "start": "node ./bin/www"
  }

希望对你有帮助。

关于node.js - Forever-npm 不会启动我的 ExpressJS 应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23876090/

相关文章:

node.js - Apollo 客户端 : Variable is not defined. 收到状态码 400

node.js - 上传功能(使用node.js的BrowserStack)

c++ - 如何在 ubuntu 中更改 g++ 的默认输出文件?

javascript - react 并表达

node.js - Pubnub Node.js 防火墙

c++ - 如何调试启动但似乎什么都不做的程序?

java - Ubuntu 16.04 : Why is the directory of tomcat 8 split up? 如何在Eclipse中引用?

javascript - 如何将 Promise 与嵌套 foreach 一起使用

javascript - 将 JWT 从 AngularJS 发送到 Node.js

node.js - Typescript 意外的 token 导入摩卡