3

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.

JacopoStanchi
  • 1,962
  • 5
  • 33
  • 61

3 Answers3

2

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
asedsami
  • 609
  • 7
  • 26
0

just use this command

sequelize migration:create --name migrationName

this command working 100%

tamil arasan
  • 57
  • 1
  • 2
0
npm run -- model:generate --name MyUser --attributes

This worked for me.

Sandeep P.
  • 19
  • 1
  • 6