model:generate gives "Missing required arguments: name, attributes"

Viewed 3674

I'm on the Windows console and here is a script of my package.json:

scripts: {
    ...
    "sequelize": "node_modules\\.bin\\sequelize.cmd"
}

When I run this command: npm run-script sequelize model:generate --name Person --attributes name:string,age:integer, I get this error:

Missing required arguments: name, attributes

But when I run this command: node_modules\.bin\sequelize.cmd model:generate --name Person --attributes name:string,age:integer it works well.

Why do I get this problem?

Thank you for your help.

2 Answers

Running this command

npm run sequelize model:generate --name User --attributes name:string

will run this(not passing the args):

node_modules/.bin/sequelize

passing arguments through npm is done by adding an extra --:

npm run sequelize -- model:generate --name User --attributes

just use this command

sequelize migration:create --name migrationName

this command working 100%

Related