unknown command: drizzle-kit

Can't seem to get the command to work. Followed the instructions of the quick start guide. Any ideas?
15 Replies
Schred
Schred•2y ago
Pretty sure you need to put an npx in front of it I.e. npx drizzle-kit generate:pg for example
SteveS
SteveSOP•2y ago
Oh, nice yeah that fixed it Any idea why I'm getting "Host and database required" given my config?
SteveS
SteveSOP•2y ago
SteveS
SteveSOP•2y ago
Schred
Schred•2y ago
Yeah I've been getting that same error when trying to push:pg, can't help you with that, sorry
SteveS
SteveSOP•2y ago
Damn, maybe the developer will see this thread. Fingers crossed
Ahmed
Ahmed•2y ago
If you're pushing to your database, drizzle will read your config file. the config doesn't have the ability to read your .env. In order the fix it you need the dotenv package. Simply import it at the top of the file import 'dotenv/config';
SteveS
SteveSOP•2y ago
Same issue
Ahmed
Ahmed•2y ago
Try providing the connectionString only
SteveS
SteveSOP•2y ago
Yeah, now it works. Do you have any idea how to deal with:
Ahmed
Ahmed•2y ago
Replace this in the end of your connection string ?ssl={"rejectUnauthorized":true} Ignore this I thought you were using Planetscale 💀
SteveS
SteveSOP•2y ago
I am
SteveS
SteveSOP•2y ago
I did that and I still get an error:
Ahmed
Ahmed•2y ago
Is this the only error message you got ?
SteveS
SteveSOP•2y ago
Yeah Uh, I reran it without changing anything and it worked I don't know if something was cached or whatever, but that's neat

Did you find this page helpful?