Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript Install and Use Sequelize CLI

Terence Wayburne
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Terence Wayburne
Full Stack JavaScript Techdegree Graduate 31,428 Points

I followed all steps and ran 'npm start' no database was created.

I followed all steps and ran 'npm start' no database was created.

I used Team Treehouses template. Double checked everything. When I run 'npm start' the server starts but no DB is created.

3 Answers

Ahmad Ibrahim
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Ahmad Ibrahim
Full Stack JavaScript Techdegree Graduate 26,074 Points

I ran into the same issue and found my problem to be in the config/config.json file it needed to look like this:

{
  "development": {
    "dialect": "sqlite",
    "storage": "development.db"
  },
  "test": {
    "dialect": "sqlite",
    "storage": "test.db"
  },
  "production": {
    "dialect": "sqlite",
    "storage": "production.db"
  }
}
William Lumanauw
William Lumanauw
5,783 Points

I experience the same issue. Then I edit my code on file www.js at line 10-11 like this :

// const { Sequelize } = require('sequelize/types');

var sequelize = require('../models').sequelize; // import Sequelize.

After that, I ran 'npm start' then the DB file was created.

Hi all,

Just incase anyone else is suffering the same issue and the above answers don't help:

Sequelize CLI provides a command that runs migrations and creates database tables:

$ npx sequelize-cli db:migrate

Running this created the development.db table in the root directory.