hapipal / boilerplate

A friendly, proven starting place for your next hapi plugin or deployment
https://hapipal.com
183 stars 27 forks source link

Switch knex to dependency for use in prod #62

Closed zemccartney closed 6 years ago

zemccartney commented 6 years ago

Yo! I did this because I got a module not found error when running the knex npm script after a production install (I think I did NODE_ENV=production npm install).

My bad if I misunderstood something! 🙏 🍹

devinivy commented 6 years ago

What knex command were you trying to run? And were you using your project as a deployment or a plugin?

zemccartney commented 6 years ago

npm run knex -- migrate:latest and using as a deployment Ay, yea, doi, sorry, I totally space on that distinction, so used to using as a deployment. Would it be preferable, then, to specify knex as a peerDependency, then, and keep it as a devDependency?

devinivy commented 6 years ago

Yes, I think that's probably the way to go. Also worth mentioning that migrations can be run on server initialization via schwifty's migrateOnStart option, and this additionally takes into account the case that there are multiple plugins on a deployment with their own migration directories.