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

Getting an error message when creating a model in my cmd

Whenever I try to create a model with the command "npm run sequelize model:create --name Article --attributes title:string,author:string,body:text" I get an error stack as follows:

Missing required arguments: name, attributes
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! blog@1.0.0 sequelize: `sequelize "model:create" "Article" "title:string,author:string,body:text"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the blog@1.0.0 sequelize script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Osaro\AppData\Roaming\npm-cache\_logs\2018-03-24T16_50_51_430Z-debug.log

1 Answer

Hi, I know this question is a little on the older side now. But, just in case anyone else runs into the same problem make sure you are running model create with the name and attributes Andrew does like this

node_modules/.bin/sequelize model:create --name Article --attributes title:string,author:string,body:text

Each model that gets created must have a name and at least 1 attribute specified in order to generate the file.