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! 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

Randy Layne
Randy Layne
Treehouse Staff

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.