2017-09-03 99 views
0
2017-09-03T18:50:57.000000+00:00 app[api]: Build started by user 
[me] 
2017-09-03T18:51:28.776809+00:00 heroku[web.1]: State changed from 
crashed to starting 
2017-09-03T18:51:28.572116+00:00 app[api]: Deploy 20b0544e by user 
[me] 
2017-09-03T18:51:28.572116+00:00 app[api]: Release v22 created by 
user [me] 
2017-09-03T18:50:57.000000+00:00 app[api]: Build succeeded 
2017-09-03T18:51:30.798246+00:00 heroku[web.1]: Starting process with 
command `node index.js` 
2017-09-03T18:51:34.045108+00:00 app[web.1]: Sun, 03 Sep 2017 
18:51:34 GMT body-parser deprecated bodyParser: use individual 
json/urlencoded middlewares at index.js:95:9 
2017-09-03T18:51:34.047680+00:00 app[web.1]: Sun, 03 Sep 2017 
18:51:34 GMT body-parser deprecated undefined extended: provide 
extended option at node_modules/body-parser/index.js:105:29 
2017-09-03T18:51:34.050039+00:00 app[web.1]: Sun, 03 Sep 2017 
18:51:34 GMT express-session deprecated undefined resave option; 
provide resave option at index.js:111:9 
2017-09-03T18:51:34.050243+00:00 app[web.1]: memory, and will not 
scale past a single process. 
2017-09-03T18:51:34.142994+00:00 app[web.1]: listening on *:5000 
2017-09-03T18:51:34.050242+00:00 app[web.1]: designed for a 
production environment, as it will leak 
2017-09-03T18:51:34.158304+00:00 app[web.1]: failed to connect to 
server [localhost:27017] on first connect [MongoError: connect 
ECONNREFUSED 127.0.0.1:27017] 
2017-09-03T18:51:34.141487+00:00 app[web.1]: (node:4) 
DeprecationWarning: `open()` is deprecated in mongoose >= 4.11.0, use 
`openUri()` instead, or set the `useMongoClient` option if using 
`connect()` or `createConnection()`. See 
http://mongoosejs.com/docs/connections.html#use-mongo-client 
2017-09-03T18:51:34.050241+00:00 app[web.1]: Warning: 
connect.session() MemoryStore is not 
2017-09-03T18:51:34.050168+00:00 app[web.1]: Sun, 03 Sep 2017 
18:51:34 GMT express-session deprecated undefined saveUninitialized 
option; provide saveUninitialized option at index.js:111:9 
2017-09-03T18:51:34.165093+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. 

所以我一直努力到现在很少success.This部署在Heroku我的Node.js应用几天确实造成了一些挫折,因为我需要这个程序运行在我的网站上。运行命令Heroku的本地Web呈现应用程序的端口5000在Heroku错误运行的Node.js应用

2017-09-03T18:51:34.158304+00:00 app[web.1]: failed to connect to 
server [localhost:27017] on first connect [MongoError: connect 
ECONNREFUSED 127.0.0.1:27017] 

我想这意味着它是我使用MongoDB的数据库问题的工作版本。当应用程序部署在生产环境中时,我将mLab用作数据库。我在代码中添加了mLab所需的连接,但它不起作用。如果有人能帮助我,我真的很感激它吗?

另外,我是否需要将安装了npm install的模块部署到heroku以使应用程序正常工作?我认为这可能是运行npm install时安装的软件包的问题。有人能指出我的问题吗?

这是一个代码链接,可能会下载这些文件,并在本地测试应用程序并尝试将它部署到Heroku,如果可能的话。

回答

0

它,因为你需要更改网址there

PS:不要让你的数据库凭据在一个开放的源代码库...

+0

我想这样做,但它没有工作,仍然得到同样的错误。我也有这个错误,也许它响了一个钟?是的,谢谢你的提问,我只是为了提出这个问题而在开放空间回购中展示db。我会在删除它之后。 警告:connect.session()MemoryStore不是 2017-09-03T21:38:51.949247 + 00:00 app [web.1]:专为生产环境设计,因为它会泄漏 2017-09-03T21:38 :51.949248 + 00:00应用程序[web.1]:内存,不会通过单个进程进行扩展。 – craynawsum

+0

它为我工作你有没有提交你的文件?对于其他问题,它似乎你的样板是真的老了,并使用许多弃用的东西,有这么多的熔岩流......我也得到这个错误:错误R10(引导超时) - > Web进程无法绑定到$ PORT内60秒的发射,你可以在这里获得修复(https://stackoverflow.com/questions/15693192/heroku-node-js-error-web-process-failed-to-bind-to-port-within-60-seconds -of) –

+0

我将我的文件提交到heroku https://mysterious-sands-16659.herokuapp.com/ – craynawsum