I`m in the right path, but it is resulting in error
Windows command line:
npx sequelize model:generate --name User --attributes firstName:string,lastName:string,email:string,password:string
output:
Invalid or unexpected token
I`m in the right path, but it is resulting in error
Windows command line:
npx sequelize model:generate --name User --attributes firstName:string,lastName:string,email:string,password:string
output:
Invalid or unexpected token
Check your .sequelizerc
const path = require('path')
module.export = {
'config': path.resolve('config', 'config.js')
}
First, you need to execute the init
command:
$npx sequelize-cli init
Second, your syntax is wrong. It should be:
$ npx sequelize-cli model:generate --name User --attributes firstName:string,lastName:string,email:string
Your syntax is just $npx-sequelize mode:migrate
it lacks -cli
When I got this error (and I know this is uncommon, but it might be useful) it turned out I was running node v6.13.4
. The reason is because I am using nvm
and that defaults to that node
version.
Check the version of node that you are using
node --version
6.13.4
If you are not using nvm
, update your version of node
by some method. If you are, you can just tell nvm
to fix it.
nvm install stable
nvm use stable