keystone-starter
keystone-starter copied to clipboard
Fails without .env file
Just tried deploying with the deploy to heroku button and it failed with this message:
2016-08-23T04:56:14.189018+00:00 heroku[web.1]: Starting process with command `node keystone.js`
2016-08-23T04:56:16.579796+00:00 app[web.1]: { [Error: ENOENT: no such file or directory, open '.env'] errno: -2, code: 'ENOENT', syscall: 'open', path: '.env' }
2016-08-23T04:56:19.111807+00:00 app[web.1]: { [Error: Cannot find module '../build/Release/bson'] code: 'MODULE_NOT_FOUND' }
2016-08-23T04:56:19.738442+00:00 app[web.1]: ------------------------------------------------
2016-08-23T04:56:19.738481+00:00 app[web.1]: Mongo Error:
2016-08-23T04:56:19.738481+00:00 app[web.1]:
2016-08-23T04:56:19.738750+00:00 app[web.1]: [Error: failed to connect to [localhost:27017]]
2016-08-23T04:56:19.741292+00:00 app[web.1]: ^
2016-08-23T04:56:19.741297+00:00 app[web.1]:
2016-08-23T04:56:19.741298+00:00 app[web.1]: Error: KeystoneJS (KeystoneJS) failed to start
2016-08-23T04:56:19.741299+00:00 app[web.1]: at NativeConnection.<anonymous> (/app/node_modules/keystone/lib/core/mount.js:630:10)
2016-08-23T04:56:19.741300+00:00 app[web.1]: at NativeConnection.emit (events.js:182:7)
2016-08-23T04:56:19.741301+00:00 app[web.1]: at /app/node_modules/mongoose/lib/connection.js:416:14
2016-08-23T04:56:19.741303+00:00 app[web.1]: at /app/node_modules/mongoose/node_modules/mongodb/lib/mongodb/db.js:286:18
2016-08-23T04:56:19.741305+00:00 app[web.1]: at process._tickCallback (internal/process/next_tick.js:98:9)
2016-08-23T04:56:19.801046+00:00 heroku[web.1]: Process exited with status 1
2016-08-23T04:56:19.812309+00:00 heroku[web.1]: State changed from starting to crashed
I presume its because there's no .env file, perhaps require("dotenv").load()
could be wrapped in a try/catch
Check out: https://github.com/JedWatson/keystone-starter/issues/7