我正在尝试在heroku上运行一个node.js应用程序,它在本地使用npm start和heroku运行得很好,但在托管在heroku上时不能运行。我已经查看了我能找到的所有解决方案,远程mongodb数据库在使用npm start运行时工作正常,我的端口设置正确,已经多次重启heroku和dynamos,并且我有一个包含以下内容的procfile:
web node index.js以下是我收到的控制台消息:
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:
{
"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"
}任何建议都将不胜感激,提前谢谢。
https://stackoverflow.com/questions/47640492
复制相似问题