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 trialTerence Wayburne
Full Stack JavaScript Techdegree Graduate 31,428 PointsI 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
Full Stack JavaScript Techdegree Graduate 26,074 PointsI 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
5,783 PointsI 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.
Berian Lowe
22,438 PointsHi 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.
Trevor Maltbie
Full Stack JavaScript Techdegree Graduate 17,021 PointsTrevor Maltbie
Full Stack JavaScript Techdegree Graduate 17,021 PointsIt would be easier to assist you if you posted your code. Upload to github and share your repo.