stevenjmarsh / hapi-starting-point

A simple node / hapi application (handlebars, bookshelf, ...) for learning and a project starting point.
MIT License
6 stars 2 forks source link

migrate issue #4

Closed walshe closed 6 years ago

walshe commented 6 years ago

when i run 'npm run knex:migrate'

> hapi-boilerplate@1.0.0 knex:migrate /Users/emmett/dev/yyy/aggregated-inv-svc
> knex migrate:latest

path.js:28
    throw new TypeError('Path must be a string. Received ' + inspect(path));
    ^

TypeError: Path must be a string. Received null
    at assertPath (path.js:28:11)
    at Object.basename (path.js:1390:5)
    at Liftoff.buildEnvironment (/Users/emmett/dev/yy/aggregated-inv-svc/node_modules/knex/node_modules/liftoff/index.js:113:52)
    at Liftoff.<anonymous> (/Users/emmett/dev/yyy/aggregated-inv-svc/node_modules/knex/node_modules/liftoff/index.js:181:32)
    at module.exports (/Users/emmett/dev/yyy/aggregated-inv-svc/node_modules/knex/node_modules/flagged-respawn/index.js:17:3)
    at Liftoff.<anonymous> (/Users/emmett/dev/yyy/aggregated-inv-svc/node_modules/knex/node_modules/liftoff/index.js:174:9)
    at /Users/emmett/dev/yyy/aggregated-inv-svc/node_modules/knex/node_modules/liftoff/index.js:148:9
    at /Users/emmett/dev/yyy/aggregated-inv-svc/node_modules/v8flags/index.js:110:14
    at /Users/emmett/dev/yyy/aggregated-inv-svc/node_modules/v8flags/index.js:38:12
    at /Users/emmett/dev/yyy/aggregated-inv-svc/node_modules/v8flags/index.js:49:7
    at _combinedTickCallback (internal/process/next_tick.js:131:7)
    at process._tickCallback (internal/process/next_tick.js:180:9)
    at Function.Module.runMain (module.js:686:11)
    at startup (bootstrap_node.js:187:16)
    at bootstrap_node.js:608:3
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! hapi-boilerplate@1.0.0 knex:migrate: `knex migrate:latest`
npm ERR! Exit status 1
npm ERR!
walshe commented 6 years ago

solved it - had some files in different directories than the original repo

  "scripts": {
    "knex:migrate:test": "NODE_ENV=test knex migrate:latest --knexfile './db/knexfile.js' --cwd .",
stevenjmarsh commented 6 years ago

cool, thanks for the follow up.