1
votes

I'm trying to create a sample app, using this article:

https://arjunphp.com/restful-api-using-async-await-node-express-sequelize/

But when a try to execute database migration with sequenze-cli on sqlite, a have always the same error:

C:\WORKING\todo\todos-manager>sequelize db:migrate

Sequelize CLI [Node: 10.16.0, CLI: 5.5.0, ORM: 5.8.12]

Loaded configuration file "config\config.json".
Using environment "development".

ERROR: Please install sqlite3 package manually

I've already tried to rebuild, with no success.

Any ideas?

5
You have to install sqlite3 package additionally, as said in the error message. Run npm install sqlite3 --save. - Anna Tolochko
Already done, no success! - elena
Strange. Have you tried completely removing the node_modules directory and running fresh npm install? - Anna Tolochko
@AnnaPohorielova: yes! - elena

5 Answers

1
votes

UPDATE:

the error does not occur if I use the statement:

npx sequelize-cli db:migrate

instead of

sequelize db:migrate

and migration completes successful!

I hope it's useful to someone.

Thanks to all!

1
votes

First install sequelize-cli globally

sudo npm install -g sequelize-cli

Then use the following command to execute migrations.

sequelize db:migrate
0
votes

in my case both:
npx sequelize-cli db:migrate
and
sequelize db:migrate
didn't work.
I don't know if its a bad practice but only global installation:
npm i -g sqlite3
solve the issue for me

0
votes

In my case sqllite3 was not installed due to node version mismatch . I switched my node version to v9.11.1 and the error is gone afterwards.

0
votes

Might be bit late but writing this for since there is no accepted answer yet :)

I tried with Node10.x , your installed sqlite3 version might not be matching with Node-version, so please switch your version to Node8.x or 9.x.

Use NVM to switch between versions and try avoid installing packages globally.