ERROR: Attribute '' cannot be parsed: Cannot read property 'dataType' of undefined

ERROR: Attribute '' cannot be parsed: Cannot read property 'dataType' of undefined

我正在使用以下 cli 命令创建 document_types table

sequelize model:create --name User --attributes name:string, username:string, email:string, password:string

解决方法:去掉不同属性之间的逗号后的space以避免错误,正确的命令是:

sequelize model:create --name User --attributes name:string,username:string,email:string,password:string