I have tried to install the latest strapi version with the following command:
npx create-strapi-app@latest strapi_test
After going through the manual steps and choosing postgres as my db, from within my folder I run the yarn develop
command, but then I get the following error:
debug: ⛔️ Server wasn't able to start properly.
error: database "strapi_test" does not exist
What have I done wrong? I am running node v16.13.0, npm v8.2.0 and on Mac OS Monterey v12.2.1
Had the same problem, turns out you need to create the database yourself with psql. So you need to run:
psql -U postgres
create database strapi_test;
It should work correctly after this.
Just to add to what @Unbound said above:
What's missing from the equation, after installing PostegreSQL, is the psql command not being available globally. So what you have to do, is define the directory in the PATH variable globally. I had to look through the folders, to find the correct location of the executable, but in the end I ran this command (PostgreSQL 15):
export PATH=/Library/PostgreSQL/15/bin:$PATH
After running this command, psql worked wonders everywhere. You might have to start new terminal session as well - to see it work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With