Node.js 在Heroku上部署NodeJs应用程序时出错
我尝试在Heroku上部署我的NodeJs应用程序,遵循Heroku指南上的所有步骤,但无法使其运行。以下是日志:Node.js 在Heroku上部署NodeJs应用程序时出错,node.js,heroku,Node.js,Heroku,我尝试在Heroku上部署我的NodeJs应用程序,遵循Heroku指南上的所有步骤,但无法使其运行。以下是日志: 2016-06-27T18:46:16.424477+00:00 heroku[web.1]: State changed from crashed to starting 2016-06-27T18:46:18.594534+00:00 heroku[web.1]: Starting process with command `npm start` 2016-06
2016-06-27T18:46:16.424477+00:00 heroku[web.1]: State changed from crashed to starting
2016-06-27T18:46:18.594534+00:00 heroku[web.1]: Starting process with command `npm start`
2016-06-27T18:46:21.204182+00:00 app[web.1]: npm ERR! Linux 3.13.0-85-generic
2016-06-27T18:46:21.205909+00:00 app[web.1]: npm ERR! npm v3.8.6
2016-06-27T18:46:21.204971+00:00 app[web.1]: npm ERR! argv "/app/.heroku/node/bin/node" "/app/.heroku/node/bin/npm" "start"
2016-06-27T18:46:21.209309+00:00 app[web.1]: npm ERR! missing script: start
2016-06-27T18:46:21.221679+00:00 app[web.1]: npm ERR! Please include the following file with any support request:
2016-06-27T18:46:21.209934+00:00 app[web.1]: npm ERR! <https://github.com/npm/npm/issues>
2016-06-27T18:46:21.207755+00:00 app[web.1]:
2016-06-27T18:46:21.221362+00:00 app[web.1]:
2016-06-27T18:46:21.209552+00:00 app[web.1]: npm ERR!
2016-06-27T18:46:21.209740+00:00 app[web.1]: npm ERR! If you need help, you may report this error at:
2016-06-27T18:46:21.221872+00:00 app[web.1]: npm ERR! /app/npm-debug.log
2016-06-27T18:46:21.205374+00:00 app[web.1]: npm ERR! node v5.11.1
2016-06-27T18:46:22.240678+00:00 heroku[web.1]: Process exited with status 1
2016-06-27T18:46:22.255389+00:00 heroku[web.1]: State changed from starting to crashed
程序文件:
web: npm start
你需要告诉Heroku如何启动你的应用程序。可以通过在package.json中指定一个“start”脚本或提供一个Procfile来实现这一点。您需要告诉Heroku如何启动您的应用程序。可以通过在package.json中指定一个“start”脚本,或者通过提供一个Procfile来实现这一点。package.json 程序文件 上面的
package.json
是一个没有Procfile的文件。然而,如果你想要一个,你可以定义如下:
web: node app.js
package.json
程序文件
上面的package.json
是一个没有Procfile的文件。然而,如果你想要一个,你可以定义如下:
web: node app.js
已经这样做了,我将在这里发布我的package.json和Procfile。已经这样做了,我将在这里发布我的package.json和Procfile。
web: node app.js