Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/heroku/2.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 无法将节点js应用程序从云9部署到heroku_Node.js_Heroku_Deployment - Fatal编程技术网

Node.js 无法将节点js应用程序从云9部署到heroku

Node.js 无法将节点js应用程序从云9部署到heroku,node.js,heroku,deployment,Node.js,Heroku,Deployment,这是一个小应用程序,我按照所有说明进行操作,包括添加开始脚本,但我一直从heroku收到这个错误 这是package.json文件 { "name": "marv", "version": "1.0.0", "description": "A profolio page", "main": "app.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1",

这是一个小应用程序,我按照所有说明进行操作,包括添加
开始脚本
,但我一直从heroku收到这个错误

这是package.json文件

{
  "name": "marv",
  "version": "1.0.0",
  "description": "A profolio page",
  "main": "app.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "start": "node app.js"
  },
  "author": "mike",
  "license": "ISC",
  "dependencies": {
    "ejs": "^2.5.5",
    "express": "^4.14.1"
  }
}
这就是错误所在-

2017-01-31T05:11:14.825901+00:00 app[api]: Release v1 created by user youraveragecoder@gmail.com
2017-01-31T05:11:14.825901+00:00 app[api]: Initial release by user youraveragecoder@gmail.com
2017-01-31T05:11:14.989987+00:00 app[api]: Enable Logplex by user youraveragecoder@gmail.com
2017-01-31T05:11:14.989987+00:00 app[api]: Release v2 created by user youraveragecoder@gmail.com
2017-01-31T05:20:36.077445+00:00 heroku[slug-compiler]: Slug compilation started
2017-01-31T05:20:36.077451+00:00 heroku[slug-compiler]: Slug compilation finished
2017-01-31T05:20:35.734320+00:00 app[api]: Scaled to web@1:Free by user youraveragecoder@gmail.com
2017-01-31T05:20:35.718069+00:00 app[api]: Release v3 created by user youraveragecoder@gmail.com
2017-01-31T05:20:35.718069+00:00 app[api]: Deploy 7f1c52d by user youraveragecoder@gmail.com
2017-01-31T05:20:37.566305+00:00 heroku[web.1]: Starting process with command `npm start`
2017-01-31T05:20:41.088789+00:00 app[web.1]: 
2017-01-31T05:20:41.088803+00:00 app[web.1]: > marv@1.0.0 start /app
2017-01-31T05:20:41.088804+00:00 app[web.1]: > start
2017-01-31T05:20:41.088805+00:00 app[web.1]: 
2017-01-31T05:20:41.097045+00:00 app[web.1]: sh: 1: start: not found
2017-01-31T05:20:41.103526+00:00 app[web.1]: 
2017-01-31T05:20:41.116072+00:00 app[web.1]: npm ERR! Linux 3.13.0-105-generic
2017-01-31T05:20:41.116428+00:00 app[web.1]: npm ERR! argv "/app/.heroku/node/bin/node" "/app/.heroku/node/bin/npm" "start"
2017-01-31T05:20:41.116677+00:00 app[web.1]: npm ERR! node v6.9.1
2017-01-31T05:20:41.116934+00:00 app[web.1]: npm ERR! npm  v3.10.8
2017-01-31T05:20:41.117178+00:00 app[web.1]: npm ERR! file sh
2017-01-31T05:20:41.117442+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2017-01-31T05:20:41.117721+00:00 app[web.1]: npm ERR! errno ENOENT
2017-01-31T05:20:41.117993+00:00 app[web.1]: npm ERR! syscall spawn
2017-01-31T05:20:41.118222+00:00 app[web.1]: npm ERR! marv@1.0.0 start: `start`
2017-01-31T05:20:41.118415+00:00 app[web.1]: npm ERR! spawn ENOENT
2017-01-31T05:20:41.118630+00:00 app[web.1]: npm ERR! 
2017-01-31T05:20:41.118873+00:00 app[web.1]: npm ERR! Failed at the marv@1.0.0 start script 'start'.
2017-01-31T05:20:41.119049+00:00 app[web.1]: npm ERR! Make sure you have the latest version of node.js and npm installed.
2017-01-31T05:20:41.119467+00:00 app[web.1]: npm ERR! If you do, this is most likely a problem with the marv package,
2017-01-31T05:20:41.120001+00:00 app[web.1]: npm ERR!     start
2017-01-31T05:20:41.119638+00:00 app[web.1]: npm ERR! not with npm itself.
2017-01-31T05:20:41.119822+00:00 app[web.1]: npm ERR! Tell the author that this fails on your system:
2017-01-31T05:20:41.120216+00:00 app[web.1]: npm ERR! You can get information on how to open an issue for this project with:
2017-01-31T05:20:41.120424+00:00 app[web.1]: npm ERR!     npm bugs marv
2017-01-31T05:20:41.120617+00:00 app[web.1]: npm ERR! Or if that isn't available, you can get their info via:
2017-01-31T05:20:41.120818+00:00 app[web.1]: npm ERR!     npm owner ls marv
2017-01-31T05:20:41.121035+00:00 app[web.1]: npm ERR! There is likely additional logging output above.
2017-01-31T05:20:41.129120+00:00 app[web.1]: 
2017-01-31T05:20:41.129459+00:00 app[web.1]: npm ERR! Please include the following file with any support request:
2017-01-31T05:20:41.129610+00:00 app[web.1]: npm ERR!     /app/npm-debug.log
2017-01-31T05:20:41.223482+00:00 heroku[web.1]: State changed from starting to crashed
2017-01-31T05:20:41.224934+00:00 heroku[web.1]: State changed from crashed to starting
2017-01-31T05:20:41.210116+00:00 heroku[web.1]: Process exited with status 1
2017-01-31T05:20:42.469734+00:00 heroku[web.1]: Starting process with command `npm start`
2017-01-31T05:20:44.883393+00:00 heroku[web.1]: Process exited with status 1
2017-01-31T05:20:44.806999+00:00 app[web.1]: 
2017-01-31T05:20:44.807014+00:00 app[web.1]: > marv@1.0.0 start /app
2017-01-31T05:20:44.807016+00:00 app[web.1]: > start
2017-01-31T05:20:44.817065+00:00 app[web.1]: 
2017-01-31T05:20:44.807016+00:00 app[web.1]: 
2017-01-31T05:20:44.812651+00:00 app[web.1]: sh: 1: start: not found
2017-01-31T05:20:44.824762+00:00 app[web.1]: npm ERR! Linux 3.13.0-105-generic
2017-01-31T05:20:44.824962+00:00 app[web.1]: npm ERR! argv "/app/.heroku/node/bin/node" "/app/.heroku/node/bin/npm" "start"
2017-01-31T05:20:44.825083+00:00 app[web.1]: npm ERR! node v6.9.1
2017-01-31T05:20:44.825202+00:00 app[web.1]: npm ERR! npm  v3.10.8
2017-01-31T05:20:44.825325+00:00 app[web.1]: npm ERR! file sh
2017-01-31T05:20:44.825437+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2017-01-31T05:20:44.825869+00:00 app[web.1]: npm ERR! spawn ENOENT
2017-01-31T05:20:44.825560+00:00 app[web.1]: npm ERR! errno ENOENT
2017-01-31T05:20:44.825670+00:00 app[web.1]: npm ERR! syscall spawn
2017-01-31T05:20:44.825786+00:00 app[web.1]: npm ERR! marv@1.0.0 start: `start`
2017-01-31T05:20:44.825959+00:00 app[web.1]: npm ERR! 
2017-01-31T05:20:44.826051+00:00 app[web.1]: npm ERR! Failed at the marv@1.0.0 start script 'start'.
2017-01-31T05:20:44.826132+00:00 app[web.1]: npm ERR! Make sure you have the latest version of node.js and npm installed.
2017-01-31T05:20:44.826213+00:00 app[web.1]: npm ERR! If you do, this is most likely a problem with the marv package,
2017-01-31T05:20:44.826297+00:00 app[web.1]: npm ERR! not with npm itself.
2017-01-31T05:20:44.826497+00:00 app[web.1]: npm ERR! Tell the author that this fails on your system:
2017-01-31T05:20:44.826869+00:00 app[web.1]: npm ERR! Or if that isn't available, you can get their info via:
2017-01-31T05:20:44.826593+00:00 app[web.1]: npm ERR!     start
2017-01-31T05:20:44.826700+00:00 app[web.1]: npm ERR! You can get information on how to open an issue for this project with:
2017-01-31T05:20:44.826781+00:00 app[web.1]: npm ERR!     npm bugs marv
2017-01-31T05:20:44.826931+00:00 app[web.1]: npm ERR!     npm owner ls marv
2017-01-31T05:20:44.827008+00:00 app[web.1]: npm ERR! There is likely additional logging output above.
2017-01-31T05:20:44.830167+00:00 app[web.1]: 
2017-01-31T05:20:44.830314+00:00 app[web.1]: npm ERR! Please include the following file with any support request:
2017-01-31T05:20:44.830375+00:00 app[web.1]: npm ERR!     /app/npm-debug.log
2017-01-31T05:20:44.899323+00:00 heroku[web.1]: State changed from starting to crashed
2017-01-31T05:21:38.894783+00:00 heroku[slug-compiler]: Slug compilation started
2017-01-31T05:21:38.894788+00:00 heroku[slug-compiler]: Slug compilation finished
2017-01-31T05:21:38.799955+00:00 app[api]: Release v4 created by user youraveragecoder@gmail.com
2017-01-31T05:21:38.799955+00:00 app[api]: Deploy 7d18209 by user youraveragecoder@gmail.com
2017-01-31T05:21:39.897641+00:00 heroku[web.1]: State changed from crashed to starting
2017-01-31T05:21:41.074961+00:00 heroku[web.1]: Starting process with command `npm start`
2017-01-31T05:21:43.515136+00:00 app[web.1]: 
2017-01-31T05:21:43.515151+00:00 app[web.1]: > marv@1.0.0 start /app
2017-01-31T05:21:43.515152+00:00 app[web.1]: > node app.js
2017-01-31T05:21:43.515153+00:00 app[web.1]: 
2017-01-31T05:21:43.697680+00:00 app[web.1]: The Server is started!!!
2017-01-31T05:21:44.743866+00:00 heroku[web.1]: State changed from starting to up
在添加PROCFILE之后,我得到了这个HEROKU日志

2017-01-31T05:26:08.229183+00:00 app[web.1]: npm ERR!     npm owner ls marv
2017-01-31T05:26:08.229058+00:00 app[web.1]: npm ERR! Or if that isn't available, you can get their info via:
2017-01-31T05:26:08.229348+00:00 app[web.1]: npm ERR! There is likely additional logging output above.
2017-01-31T05:26:08.290511+00:00 app[web.1]: 
2017-01-31T05:26:08.290781+00:00 app[web.1]: npm ERR! Please include the following file with any support request:
2017-01-31T05:26:08.290916+00:00 app[web.1]: npm ERR!     /app/npm-debug.log
2017-01-31T05:26:08.475246+00:00 app[web.1]: 
2017-01-31T05:26:08.545154+00:00 app[web.1]: npm ERR! Linux 3.13.0-105-generic
2017-01-31T05:26:08.545500+00:00 app[web.1]: npm ERR! argv "/app/.heroku/node/bin/node" "/app/.heroku/node/bin/npm" "start"
2017-01-31T05:26:08.546159+00:00 app[web.1]: npm ERR! node v6.9.1
2017-01-31T05:26:08.546417+00:00 app[web.1]: npm ERR! npm  v3.10.8
2017-01-31T05:26:08.546666+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2017-01-31T05:26:08.546882+00:00 app[web.1]: npm ERR! marv@1.0.0 start: `npm start`
2017-01-31T05:26:08.547076+00:00 app[web.1]: npm ERR! Exit status 1
2017-01-31T05:26:08.549104+00:00 app[web.1]: npm ERR! 
2017-01-31T05:26:08.549297+00:00 app[web.1]: npm ERR! Failed at the marv@1.0.0 start script 'npm start'.
2017-01-31T05:26:08.549462+00:00 app[web.1]: npm ERR! Make sure you have the latest version of node.js and npm installed.
2017-01-31T05:26:08.549604+00:00 app[web.1]: npm ERR! If you do, this is most likely a problem with the marv package,
2017-01-31T05:26:08.549790+00:00 app[web.1]: npm ERR! not with npm itself.
2017-01-31T05:26:08.549969+00:00 app[web.1]: npm ERR! Tell the author that this fails on your system:
2017-01-31T05:26:08.550147+00:00 app[web.1]: npm ERR!     npm start
2017-01-31T05:26:08.550318+00:00 app[web.1]: npm ERR! You can get information on how to open an issue for this project with:
2017-01-31T05:26:08.550487+00:00 app[web.1]: npm ERR!     npm bugs marv
2017-01-31T05:26:08.550681+00:00 app[web.1]: npm ERR! Or if that isn't available, you can get their info via:
2017-01-31T05:26:08.550872+00:00 app[web.1]: npm ERR!     npm owner ls marv
2017-01-31T05:26:08.551060+00:00 app[web.1]: npm ERR! There is likely additional logging output above.
2017-01-31T05:26:08.617254+00:00 app[web.1]: 
2017-01-31T05:26:08.617509+00:00 app[web.1]: npm ERR! Please include the following file with any support request:
2017-01-31T05:26:08.618004+00:00 app[web.1]: npm ERR!     /app/npm-debug.log
2017-01-31T05:26:08.830443+00:00 app[web.1]: 
2017-01-31T05:26:08.892539+00:00 app[web.1]: npm ERR! Linux 3.13.0-105-generic
2017-01-31T05:26:08.893654+00:00 app[web.1]: npm ERR! npm  v3.10.8
2017-01-31T05:26:08.892769+00:00 app[web.1]: npm ERR! argv "/app/.heroku/node/bin/node" "/app/.heroku/node/bin/npm" "start"
2017-01-31T05:26:08.893455+00:00 app[web.1]: npm ERR! node v6.9.1
2017-01-31T05:26:08.894315+00:00 app[web.1]: npm ERR! Make sure you have the latest version of node.js and npm installed.
2017-01-31T05:26:08.893808+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2017-01-31T05:26:08.894418+00:00 app[web.1]: npm ERR! If you do, this is most likely a problem with the marv package,
2017-01-31T05:26:08.893949+00:00 app[web.1]: npm ERR! marv@1.0.0 start: `npm start`
2017-01-31T05:26:08.894066+00:00 app[web.1]: npm ERR! Exit status 1
2017-01-31T05:26:08.895201+00:00 app[web.1]: npm ERR!     npm start
2017-01-31T05:26:08.894251+00:00 app[web.1]: npm ERR! 
2017-01-31T05:26:08.894256+00:00 app[web.1]: npm ERR! Failed at the marv@1.0.0 start script 'npm start'.
2017-01-31T05:26:08.894521+00:00 app[web.1]: npm ERR! not with npm itself.
2017-01-31T05:26:08.894990+00:00 app[web.1]: npm ERR! Tell the author that this fails on your system:
2017-01-31T05:26:08.895202+00:00 app[web.1]: npm ERR! You can get information on how to open an issue for this project with:
2017-01-31T05:26:08.952788+00:00 app[web.1]: 
2017-01-31T05:26:08.953066+00:00 app[web.1]: npm ERR! Please include the following file with any support request:
2017-01-31T05:26:08.895282+00:00 app[web.1]: npm ERR!     npm bugs marv
2017-01-31T05:26:08.897067+00:00 app[web.1]: npm ERR! Or if that isn't available, you can get their info via:
2017-01-31T05:26:08.897178+00:00 app[web.1]: npm ERR!     npm owner ls marv
2017-01-31T05:26:08.897280+00:00 app[web.1]: npm ERR! There is likely additional logging output above.
2017-01-31T05:26:08.953178+00:00 app[web.1]: npm ERR!     /app/npm-debug.log
2017-01-31T05:26:09.150119+00:00 app[web.1]: 
2017-01-31T05:26:09.217843+00:00 app[web.1]: npm ERR! Linux 3.13.0-105-generic
2017-01-31T05:26:09.218096+00:00 app[web.1]: npm ERR! argv "/app/.heroku/node/bin/node" "/app/.heroku/node/bin/npm" "start"
2017-01-31T05:26:09.218486+00:00 app[web.1]: npm ERR! npm  v3.10.8
2017-01-31T05:26:09.218813+00:00 app[web.1]: npm ERR! marv@1.0.0 start: `npm start`
2017-01-31T05:26:09.218310+00:00 app[web.1]: npm ERR! node v6.9.1
2017-01-31T05:26:09.219095+00:00 app[web.1]: npm ERR! 
2017-01-31T05:26:09.219227+00:00 app[web.1]: npm ERR! Failed at the marv@1.0.0 start script 'npm start'.
2017-01-31T05:26:09.219367+00:00 app[web.1]: npm ERR! Make sure you have the latest version of node.js and npm installed.
2017-01-31T05:26:09.219511+00:00 app[web.1]: npm ERR! If you do, this is most likely a problem with the marv package,
2017-01-31T05:26:09.218971+00:00 app[web.1]: npm ERR! Exit status 1
2017-01-31T05:26:09.218661+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2017-01-31T05:26:09.219614+00:00 app[web.1]: npm ERR! not with npm itself.
2017-01-31T05:26:09.220306+00:00 app[web.1]: npm ERR!     npm start
2017-01-31T05:26:09.221240+00:00 app[web.1]: npm ERR!     npm bugs marv
2017-01-31T05:26:09.219752+00:00 app[web.1]: npm ERR! Tell the author that this fails on your system:
2017-01-31T05:26:09.223347+00:00 app[web.1]: npm ERR!     npm owner ls marv
2017-01-31T05:26:09.223736+00:00 app[web.1]: npm ERR! There is likely additional logging output above.
2017-01-31T05:26:09.290178+00:00 app[web.1]: 
2017-01-31T05:26:09.290435+00:00 app[web.1]: npm ERR! Please include the following file with any support request:
2017-01-31T05:26:09.221908+00:00 app[web.1]: npm ERR! Or if that isn't available, you can get their info via:
2017-01-31T05:26:09.220453+00:00 app[web.1]: npm ERR! You can get information on how to open an issue for this project with:
2017-01-31T05:26:09.290544+00:00 app[web.1]: npm ERR!     /app/npm-debug.log
2017-01-31T05:26:09.404748+00:00 heroku[web.1]: Process exited with status 1
2017-01-31T05:26:09.443702+00:00 heroku[web.1]: State changed from starting to crashed
2017-01-31T05:35:34.314557+00:00 heroku[slug-compiler]: Slug compilation started
2017-01-31T05:35:34.314566+00:00 heroku[slug-compiler]: Slug compilation finished
2017-01-31T05:35:34.176941+00:00 app[api]: Release v6 created by user youraveragecoder@gmail.com
2017-01-31T05:35:34.176941+00:00 app[api]: Deploy 824747a by user youraveragecoder@gmail.com
2017-01-31T05:35:34.977944+00:00 heroku[web.1]: State changed from crashed to starting
2017-01-31T05:35:36.147096+00:00 heroku[web.1]: Starting process with command `npm start`
2017-01-31T05:35:38.722345+00:00 app[web.1]: > marv@1.0.0 start /app
2017-01-31T05:35:38.722346+00:00 app[web.1]: > node app.js
2017-01-31T05:35:38.722347+00:00 app[web.1]: 
2017-01-31T05:35:38.722331+00:00 app[web.1]: 
2017-01-31T05:35:38.920123+00:00 app[web.1]: The Server is started!!!
2017-01-31T05:35:39.924169+00:00 heroku[web.1]: State changed from starting to up
2017-01-31T06:10:46.642422+00:00 heroku[web.1]: Idling
2017-01-31T06:10:46.643066+00:00 heroku[web.1]: State changed from up to down
2017-01-31T06:10:47.333913+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2017-01-31T06:10:47.511409+00:00 heroku[web.1]: Process exited with status 143
2017-01-31T06:48:20.922256+00:00 heroku[slug-compiler]: Slug compilation started
2017-01-31T06:48:20.922263+00:00 heroku[slug-compiler]: Slug compilation finished
2017-01-31T06:48:20.740607+00:00 app[api]: Release v7 created by user youraveragecoder@gmail.com
2017-01-31T06:48:20.740607+00:00 app[api]: Deploy b5ee661 by user youraveragecoder@gmail.com
2017-01-31T06:48:21.077507+00:00 heroku[web.1]: State changed from down to starting
2017-01-31T06:48:22.779283+00:00 heroku[web.1]: Starting process with command `node app.js`
2017-01-31T06:48:25.506272+00:00 app[web.1]: The Server is started!!!
2017-01-31T06:48:26.473056+00:00 heroku[web.1]: State changed from starting to up

heroku似乎无法找到启动服务器的正确文件。你能发布你的package.json吗?通过哪个文件启动服务器。确保您package.json中的启动脚本具有启动服务器的正确命令。让我为您发布我的package.json文件您的应用程序在本地工作正常吗?如果是,那么您如何在本地运行它?我的意思是,你在本地运行哪个命令。它在本地运行我使用node app.js来运行这个应用程序,它是一个简单的2页html框架,试图创建一个对开本页面,但首先我试图首先部署它,只是为了确定,我已经搜索过了,我只是不理解这个错误应该起作用。使用start命令确保heroku服务器具有此package.json。作为另一种选择—遵循此操作—在项目的根目录中创建一个名为Procfile的文件,并将这一行添加到文件中—
web:node app.js
。再次将应用程序推送到Heroku。之后,Heroku将尝试使用Procfile运行应用程序。