Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/41.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
关于部署Node.js项目的Hroku问题-简单一个_Node.js_Heroku - Fatal编程技术网

关于部署Node.js项目的Hroku问题-简单一个

关于部署Node.js项目的Hroku问题-简单一个,node.js,heroku,Node.js,Heroku,我最近部署了simple node.js,它可以进行web聊天,这是一段非常简单的代码。但当我访问部署的URL时,会说: { "name": "RealTimeWebChat", "version": "0.0.0", "description": "real time web chat using node.js power :D", "main": "index.js", "scripts": { "test": "echo \"Err

我最近部署了simple node.js,它可以进行web聊天,这是一段非常简单的代码。但当我访问部署的URL时,会说:

{
    "name": "RealTimeWebChat",
    "version": "0.0.0",
    "description": "real time web chat using node.js power :D",
    "main": "index.js",
    "scripts": {
        "test": "echo \"Error: no test specified\" && exit 1",
        "start": "node index.js"
    },
    "repository": {
        "type": "git",
        "url": "git+https://github.com/CodeKnight986/webchat.git"
    },
  "keywords": [],
  "author": "",
    "dependencies": {
        "socket.io": "latest",
        "express-handlebars": "3.0.0",
        "express-session": "1.13.0",
        "passport": "0.3.2",
        "passport-local": "1.0.0",
        "html-entities": "1.2.0"
    },
    "author": "ray - codeknight"
}
应用程序错误应用程序和页面中发生错误 不能上菜。请稍后再试

如果您是应用程序所有者,请查看日志以了解详细信息

我查过日志,上面写着:

2016-10-18T05:25:28.021356+00:00 app[web.1]:     at require (internal/module.js:12:17)
2016-10-18T05:25:28.021357+00:00 app[web.1]:     at Object.<anonymous> (/app/app/web/index.js:3:17)
2016-10-18T05:25:28.021357+00:00 app[web.1]:     at Module._compile (module.js:409:26)
2016-10-18T05:25:28.021356+00:00 app[web.1]:     at Module.require (module.js:353:17)
2016-10-18T05:25:28.021358+00:00 app[web.1]:     at Object.Module._extensions..js (module.js:416:10)
2016-10-18T05:25:28.021358+00:00 app[web.1]:     at Module.load (module.js:343:32)
2016-10-18T05:25:28.021359+00:00 app[web.1]:     at Function.Module._load (module.js:300:12)
2016-10-18T05:25:28.021370+00:00 app[web.1]:     at Module.require (module.js:353:17)
2016-10-18T05:25:28.152443+00:00 heroku[web.1]: State changed from starting to crashed
2016-10-18T05:25:28.982052+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=realtime-web-chat-simple.herokuapp.com request_id=93c0506d-02e9-4505-a357-9e8d6578d007 fwd="45.56.152.21" dyno= connect= service= status=503 bytes=
2016-10-18T05:25:30.286843+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=realtime-web-chat-simple.herokuapp.com request_id=2a3caade-896a-4ae2-8fd9-6e5ec66fed78 fwd="45.56.152.21" dyno= connect= service= status=503 bytes=

任何帮助都将不胜感激。

如果它在本地工作,也许最好使用,以便使用您在本地使用的相同版本


如果它不起作用,您可以尝试添加一个too来指定要运行的命令

,如果它在本地起作用,那么最好使用本地使用的相同版本

如果它不起作用,您可以尝试添加一个too来指定要运行的命令。好吧,算了吧。 我发现我没有在package.json文件中添加express模块。 添加它解决了这个问题

谢谢。

好吧,算了吧。 我发现我没有在package.json文件中添加express模块。 添加它解决了这个问题


谢谢。

谢谢你的回答,但这并不能解决问题:-(谢谢你的回答,但这并不能解决问题-(