【问题标题】:heroku error while deploying node app部署节点应用程序时出现heroku错误
【发布时间】:2014-02-25 07:44:30
【问题描述】:

我正在尝试将应用程序部署到 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)

有人吗?

谢谢!

【问题讨论】:

    标签: javascript node.js heroku


    【解决方案1】:

    是mongoose版本的问题

    【讨论】:

      【解决方案2】:

      嗯,我认为您正在尝试使用自己的文件,这句话:

      require('./proto');
      

      您的 proto.js 文件是否在同一目录中?好像是找不到那个模块。

      【讨论】:

        【解决方案3】:

        检查您的 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

        【讨论】:

        • 我知道这是因为它找不到它。但这不应该是问题。这是一个依赖项,因为 connect 使用 express 在 package.json 上......所以它不应该是这样的。
        猜你喜欢
        • 2020-07-16
        • 2018-01-04
        • 2016-04-09
        • 2017-02-04
        • 2013-02-15
        • 1970-01-01
        • 2018-11-23
        • 2021-12-06
        • 2021-11-27
        相关资源
        最近更新 更多