部署节点应用程序时出现heroku错误

时间:2012-12-17 14:44:44

标签: javascript node.js heroku

我正在尝试将应用部署到heroku。到目前为止一切工作正常....我不知道我做了什么,但每次我开始这个过程我都会收到这个错误,

2012-12-17T14:36:42+00:00 heroku[web.1]: State changed from up to starting
2012-12-17T14:36:42+00:00 heroku[slugc]: Slug compilation finished
2012-12-17T14:36:44+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2012-12-17T14:36:46+00:00 heroku[web.1]: Process exited with status 1
2012-12-17T14:36:47+00:00 heroku[web.1]: State changed from starting to crashed
2012-12-17T14:36:47+00:00 heroku[web.1]: State changed from crashed to starting
2012-12-17T14:36:48+00:00 heroku[web.1]: Starting process with command `node app.js`
2012-12-17T14:36:49+00:00 app[web.1]: module.js:340
2012-12-17T14:36:49+00:00 app[web.1]:           ^
2012-12-17T14:36:49+00:00 app[web.1]: 
2012-12-17T14:36:49+00:00 app[web.1]:     throw err;
2012-12-17T14:36:49+00:00 app[web.1]: Error: Cannot find module './proto'
2012-12-17T14:36:49+00:00 app[web.1]:     at Function.Module._resolveFilename (module.js:338:15)
2012-12-17T14:36:49+00:00 app[web.1]:     at Function.Module._load (module.js:280:25)
2012-12-17T14:36:49+00:00 app[web.1]:     at Module.require (module.js:362:17)
2012-12-17T14:36:49+00:00 app[web.1]:     at require (module.js:378:17)
2012-12-17T14:36:49+00:00 app[web.1]:     at Object.<anonymous> (/app/node_modules/express/node_modules/connect/lib/connect.js:14:13)
2012-12-17T14:36:49+00:00 app[web.1]:     at Object.Module._extensions..js (module.js:467:10)
2012-12-17T14:36:49+00:00 app[web.1]:     at Module._compile (module.js:449:26)
2012-12-17T14:36:49+00:00 app[web.1]:     at Module.load (module.js:356:32)
2012-12-17T14:36:49+00:00 app[web.1]:     at Function.Module._load (module.js:312:12)
2012-12-17T14:36:49+00:00 app[web.1]:     at Module.require (module.js:362:17)

任何?

谢谢!

3 个答案:

答案 0 :(得分:0)

这是mongoose版本的问题

答案 1 :(得分:0)

嗯我认为你试图用你自己的文件,用这句话:

require('./proto');

你的proto.js文件在同一个目录中吗?似乎无法找到该模块。

答案 2 :(得分:-1)

检查你的package.json中是否有“proto”,这个错误发生了,因为它找不到依赖

package.json ex:

{
  "name": "application-name",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "node app"
  },
  "dependencies": {
    "proto": "*"
  }
}

检查一下: What is dependency in package.json - nodejs