When you run db-migrate up and the dependencies attribute not exists in package.json, the cli throws this error:
[WARN] TypeError: Cannot convert undefined or null to object
at Function.assign (<anonymous>)
at loadPluginList (/Users/ezequielm/Projects/esig/repositories/esignature-email-scheduler/node_modules/db-migrate/index.js:14:20)
at loadPlugins (/Users/ezequielm/Projects/esig/repositories/esignature-email-scheduler/node_modules/db-migrate/index.js:24:17)
at Object.module.exports.getInstance (/Users/ezequielm/Projects/esig/repositories/esignature-email-scheduler/node_modules/db-migrate/
index.js:56:51)
at /Users/ezequielm/Projects/esig/repositories/esignature-email-scheduler/node_modules/db-migrate/bin/db-migrate:32:25
at /Users/ezequielm/Projects/esig/repositories/esignature-email-scheduler/node_modules/resolve/lib/async.js:65:25
at ondir (/Users/ezequielm/Projects/esig/repositories/esignature-email-scheduler/node_modules/resolve/lib/async.js:222:27)
at onex (/Users/ezequielm/Projects/esig/repositories/esignature-email-scheduler/node_modules/resolve/lib/async.js:125:32)
at /Users/ezequielm/Projects/esig/repositories/esignature-email-scheduler/node_modules/resolve/lib/async.js:11:20
at FSReqWrap.oncomplete (fs.js:153:5)
Expected behavior
That error shouldn't be showed when dependencies and/or devDependencies attributes not exist in package.json file.
Minimal reproduction of the problem with instructions
Create a new project and run npm init
Install only dev dependencies npm i db-migrate db-migrate-pg -D
Create a migration file: ./node_modules/.bin/db-migrate create add-test-db
Run migrations ./node_modules/.bin/db-migrate up
What is the motivation / use case for changing the behavior?
The warn could be confused since it is displayed when the migration run successfully.
Environment
db-migrate version: 0.11.5
db-migrate driver with versions: pg v7.8.0
Additional information:
- Node version: 8.10
- Platform: Mac
Others:
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I'm submitting a...
Current behavior
When you run
db-migrate up
and thedependencies
attribute not exists inpackage.json
, the cli throws this error:Expected behavior
That error shouldn't be showed when
dependencies
and/ordevDependencies
attributes not exist inpackage.json
file.Minimal reproduction of the problem with instructions
npm init
npm i db-migrate db-migrate-pg -D
./node_modules/.bin/db-migrate create add-test-db
./node_modules/.bin/db-migrate up
What is the motivation / use case for changing the behavior?
The warn could be confused since it is displayed when the migration run successfully.
Environment