首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >在heroku上出现错误R10 (启动超时),在本地使用npm start和heroku时,工作时间不到5秒

在heroku上出现错误R10 (启动超时),在本地使用npm start和heroku时,工作时间不到5秒
EN

Stack Overflow用户
提问于 2017-12-05 03:22:17
回答 0查看 112关注 0票数 0

我正在尝试在heroku上运行一个node.js应用程序,它在本地使用npm start和heroku运行得很好,但在托管在heroku上时不能运行。我已经查看了我能找到的所有解决方案,远程mongodb数据库在使用npm start运行时工作正常,我的端口设置正确,已经多次重启heroku和dynamos,并且我有一个包含以下内容的procfile:

代码语言:javascript
运行
复制
web node index.js

以下是我收到的控制台消息:

代码语言:javascript
运行
复制
Starting process with command `node index.js`
Warning: connect.session() MemoryStore is not
designed for a production environment, as it will leak
memory, and will not scale past a single process.
Application ready to serve requests.
Environment: production
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
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.
DB Connection Open...
Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 
60 seconds of launch
Stopping process with SIGKILL
Process exited with status 137

这是我的package.json:

代码语言:javascript
运行
复制
{
  "name": "shop",
  "version": "0.1.0",
  "description": "eCommerce Site",
  "author": "Slav Bugryn",
  "main": "index.js",
  "scripts": {
    "test": "grunt test",
    "build": "grunt build",
    "all": "npm run build && npm run test",
    "start": "node server.js"
  },
  "dependencies": {
    "connect-flash": "^0.1.1",
    "construx": "^1.0.0",
    "construx-copier": "^1.0.0",
    "construx-dustjs": "^1.1.0",
    "construx-less": "^1.0.0",
    "dust-makara-helpers": "^4.2.0",
    "dustjs-helpers": "^1.7.3",
    "eslint": "^4.12.1",
    "express": "^4.12.2",
    "express-messages": "^1.0.1",
    "kraken-js": "^2.0.0",
    "makara": "^2.0.3",
    "mongodb": "^2.2.33",
    "mongoose": "^4.13.6",
    "requirejs": "^2.3.5"
  },
  "devDependencies": {
    "grunt": "^1.0.1",
    "grunt-cli": "^1.2.0",
    "grunt-config-dir": "^0.3.2",
    "grunt-contrib-clean": "^1.1.0",
    "grunt-contrib-less": "^1.4.1",
    "grunt-contrib-requirejs": "^1.0.0",
    "grunt-copy-to": "0.0.12",
    "grunt-dustjs": "^1.4.0",
    "grunt-eslint": "^20.1.0",
    "grunt-makara-amdify": "^1.0.1",
    "grunt-mocha-cli": "^3.0.0",
    "mocha": "^4.0.1",
    "supertest": "^3.0.0"
  },
  "directories": {
    "lib": "lib",
    "test": "test"
  },
  "keywords": [],
  "license": "ISC"
}

任何建议都将不胜感激,提前谢谢。

EN

回答

页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/47640492

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档