heroku node.js bash:节点:找不到命令 [英] heroku node.js bash: node: command not found

查看:116
本文介绍了heroku node.js bash:节点:找不到命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在雪松堆栈上的heroku上部署我的应用程序似乎出现了一个奇怪的问题,其中我的节点进程甚至没有被调用

there seems to be a strange problem with the deployment of my app on heroku on cedar stack where my node process doesn't even get called

我的Procfile如下:

my Procfile is as follows:

web: node web.js

和我的package.json文件:

and my package.json file:

{
 "name": "fuuzik",
 "version": "0.0.1",
 "dependencies": {
   "express": "3.x",
   "jade":"*",
   "mime-magic":"*"
  },
 "engines": {
  "node": "0.8.x",
  "npm": "1.1.x"
  }
}

因此,在我提交并推动heroku后,检测到它是一个节点应用程序,可以正确构建我的依赖关系,甚至说它已部署..但该应用程序在部署时立即崩溃,并且heroku日志返回:

So after i commit and push heroku detects it's a node app fine and builds my dependancies correctly and even says that it deployed .. yet the app is crashed immediately on deploy and heroku logs returns:

2012-08-29T08:52:14+00:00 heroku[api]: Deploy d9fdb17 by he610@doc.ic.ac.uk
2012-08-29T08:52:14+00:00 heroku[web.1]: State changed from crashed to starting 
2012-08-29T08:52:14+00:00 heroku[slugc]: Slug compilation finished
2012-08-29T08:52:16+00:00 heroku[web.1]: Starting process with command `node web.js`
2012-08-29T08:52:16+00:00 app[web.1]: bash: node: command not found
2012-08-29T08:52:17+00:00 heroku[web.1]: Process exited with status 127 
2012-08-29T08:52:17+00:00 heroku[web.1]: State changed from starting to crashed

foreman运行正常,并且根目录周围有几个.php文件(因为我正在移植一些旧代码),但是我很确定Procfiles的逻辑应该允许这样做.

foreman runs fine and there are a couple of .php files around the root directory (since I am porting some old code) but I am pretty sure that should be allowed by the logic of Procfiles

根据要求,这是本地npm install的输出:

As requested here's the output of npm install locally:

--[/DEBUG]--
jade@0.27.2 node_modules/jade
├── commander@0.6.1
└── mkdirp@0.3.0

express@3.0.0rc3 node_modules/express
├── methods@0.0.1
├── range-parser@0.0.4
├── fresh@0.1.0
├── cookie@0.0.4
├── crc@0.2.0
├── commander@0.6.1
├── debug@0.7.0
├── mkdirp@0.3.3
├── send@0.0.3 (mime@1.2.6)
└── connect@2.4.3 (pause@0.0.1, bytes@0.1.0, qs@0.4.2, formidable@1.0.11)

mime-magic@0.3.0 node_modules/mime-magic

这是我按下时的git日志(有点大,所以我将其链接了):

and here's the git log when i push (it's a bit big so i linked it):

http://pastebin.com/d424TBfR

任何帮助表示赞赏!

推荐答案

尝试删除您的Procfile.

Try deleting your Procfile.

很明显,Procfile指示heroku使用node main.js运行该应用程序,但是node不是有效的命令,因为它不包含在PATH变量或类似文件中.

Apparently, the Procfile indicates heroku to run the app using node main.js but node is not a valid command since it is not included in the PATH varialbe, or similar.

通过删除Procfile,heroku检测到该应用程序是流星应用程序,并使用具有完整路径的节点二进制文件运行它.

By deleting the Procfile, heroku detects that the app is a meteor app and runs it using node's binary with the full path.

此外,请记住ROOT_URL必须设置为以http://

Also, remember the ROOT_URL must be set beginning with http://

这篇关于heroku node.js bash:节点:找不到命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆