在部署到Heroku

时间:2017-06-06 04:34:33

标签: heroku meanjs

我刚刚尝试了本地主机中的meanjs 0.4.0并运行良好,但是当我部署到heroku link to app并尝试"注册"选项我在navegator控制台中得到了这个:

POST https://meanjsapptest.herokuapp.com/api/auth/signup 503 (Service Unavailable)

当我在CLI中编写命令heroku日志时,我得到:

2017-06-06T04:15:35.152983+00:00 app[web.1]: (node:16) DeprecationWarning: Mongoose: mpromise (mongoose's default promise library) is deprecated, plug in your own promise library instead: http://mongoosejs.com/docs/promises.html
2017-06-06T04:15:35.153005+00:00 app[web.1]: crypto.js:635
2017-06-06T04:15:35.153006+00:00 app[web.1]: throw new TypeError(
2017-06-06T04:15:35.153006+00:00 app[web.1]: ^
2017-06-06T04:15:35.153007+00:00 app[web.1]:
2017-06-06T04:15:35.153008+00:00 app[web.1]: TypeError: The "digest" argument is required and must not be undefined
2017-06-06T04:15:35.153009+00:00 app[web.1]: at pbkdf2 (crypto.js:635:11)
2017-06-06T04:15:35.153010+00:00 app[web.1]: at Object.exports.pbkdf2Sync (crypto.js:628:10)
2017-06-06T04:15:35.153012+00:00 app[web.1]: at model. (/app/modules/users/server/models/user.server.model.js:112:26)
2017-06-06T04:15:35.153011+00:00 app[web.1]: at model.UserSchema.methods.hashPassword (/app/modules/users/server/models/user.server.model.js:123:19)
2017-06-06T04:15:35.153013+00:00 app[web.1]: at _next (/app/node_modules/hooks-fixed/hooks.js:62:30)
2017-06-06T04:15:35.153013+00:00 app[web.1]: at fnWrapper (/app/node_modules/hooks-fixed/hooks.js:186:8)
2017-06-06T04:15:35.153014+00:00 app[web.1]: at model. (/app/node_modules/mongoose/lib/plugins/saveSubdocs.js:20:7)
2017-06-06T04:15:35.153014+00:00 app[web.1]: at _next (/app/node_modules/hooks-fixed/hooks.js:62:30)
2017-06-06T04:15:35.153015+00:00 app[web.1]: at fnWrapper (/app/node_modules/hooks-fixed/hooks.js:186:8)
2017-06-06T04:15:35.153015+00:00 app[web.1]: at /app/node_modules/mongoose/lib/plugins/validateBeforeSave.js:33:13
2017-06-06T04:15:35.153016+00:00 app[web.1]: at /app/node_modules/kareem/index.js:131:16
2017-06-06T04:15:35.153016+00:00 app[web.1]: at _combinedTickCallback (internal/process/next_tick.js:95:7)
2017-06-06T04:15:35.153017+00:00 app[web.1]: at process._tickCallback (internal/process/next_tick.js:161:9)
2017-06-06T04:15:35.167579+00:00 app[web.1]: error: Forever detected script exited with code: 1
2017-06-06T04:15:35.173500+00:00 app[web.1]: error: Script restart attempt #1
2017-06-06T04:15:35.292903+00:00 app[web.1]:
2017-06-06T04:15:35.294191+00:00 app[web.1]:
2017-06-06T04:15:35.310954+00:00 app[web.1]: + Error: Certificate file or key file is missing, falling back to non-SSL mode
2017-06-06T04:15:35.311037+00:00 app[web.1]: To create them, simply run the following from your shell: sh ./scripts/generate-ssl-certs.sh
2017-06-06T04:15:35.311039+00:00 app[web.1]:
2017-06-06T04:15:35.916892+00:00 app[web.1]: Db.prototype.authenticate method will no longer be available in the next major release 3.x as MongoDB 3.6 will only allow auth against users in the admin db and will no longer allow multiple credentials on a socket. Please authenticate using MongoClient.connect with auth credentials.

我现在不知道该怎么做,因为Heroku支持告诉我错误是在我的代码中,但我还没有改变任何东西!

CLI screenshot

1 个答案:

答案 0 :(得分:6)

刚出现这个问题。我们能够通过在package.json>中强制执行我们的首选节点版本来解决它。发动机。

我们之前有过

JTextField

我们将其更改为

"node": ">=0.10.0"

然后将其推送到Heroku,这就解决了这个问题。

不完全确定问题是什么,但我们发现此链接导致我们相信节点版本是问题:

https://github.com/nodejs/node/wiki/Breaking-changes-between-v4-LTS-and-v6-LTS#crypto