Skip to content

init error when reading from sequelrc file if folder does not exist. #534

Closed

Description

I get this error whenever I try to run the following command without the existing src/ folder:
./node_modules/.bin/sequelize init
.sequelizerc

const path = require('path');

module.exports = {
  "config": path.resolve('./src/config', 'config.json'),
  "models-path": path.resolve('./src/models'),
  "seeders-path": path.resolve('./src/seeders'),
  "migrations-path": path.resolve('./src/migrations')
};

error:

Sequelize [Node: 8.4.0, CLI: 2.8.0, ORM: 4.8.0]

Successfully created migrations folder at "/home/john/Desktop/Projects/myProject/src/migrations".
Successfully created seeders folder at "/home/john/Desktop/Projects/myProject/src/seeders".
Successfully created models folder at "/home/john/Desktop/Projects/myProjectr/src/models".
    at Object.fs.mkdirSync (fs.js:891:18)
    at Object.writeDefaultConfig (/home/john/Desktop/Projects/myProjectr/node_modules/sequelize-cli/lib/helpers/config-helper.js:97:10)
    at Object.task (/home/john/Desktop/Projects/myProject/node_modules/sequelize-cli/lib/tasks/init.js:68:24)
    at /home/john/Desktop/Projects/myProject/node_modules/sequelize-cli/lib/helpers/gulp-helper.js:17:23
    at tryCatcher (/home/john/Desktop/Projects/myProject/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/home/john/Desktop/Projects/myProject/node_modules/bluebird/js/release/promise.js:512:31)
    at Promise._settlePromise (/home/john/Desktop/Projects/myProject/node_modules/bluebird/js/release/promise.js:569:18)
    at Promise._settlePromise0 (/home/john/Desktop/Projects/myProject/node_modules/bluebird/js/release/promise.js:614:10)
    at Promise._settlePromises (/home/john/Desktop/Projects/myProject/node_modules/bluebird/js/release/promise.js:693:18)
    at Async._drainQueue (/home/john/Desktop/Projects/myProject/node_modules/bluebird/js/release/async.js:133:16)
    at Async._drainQueues (/home/john/Desktop/Projects/myProject/node_modules/bluebird/js/release/async.js:143:10)
    at Immediate.Async.drainQueues (/home/john/Desktop/Projects/myProject/node_modules/bluebird/js/release/async.js:17:14)
    at runCallback (timers.js:781:20)
    at tryOnImmediate (timers.js:743:5)
    at processImmediate [as _immediateCallback] (timers.js:714:5)

It sucessfully creates the other files, just not the config folder and the config.json file
However, if I create the src folder before hand and then run the command, it'll work just fine and it actually creates the config folder as well as config.json file.

Not sure if this a documented bug or if I'm doing something wrong. Thanks

Ubuntu 16.04
Node 8.4
NPM 5.4.1
Sequelize 4.8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions