4

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

enter image description here

enter image description here

What have I done wrong? I am running node v16.13.0, npm v8.2.0 and on Mac OS Monterey v12.2.1

2 Answers 2

8

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.

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks a lot :) I couldn't use the pql -U postgres command, as I was getting "role "postgres" does not exist" but with the command psql postgres I could create the database and then run the yarn develop command. Thanks once again, saved me a ton of headache :)
these commands are not working for me. I have installed Postgres, but when executing these commands, I get the following message in the terminal: 'psql' is not recognized as an internal or external command, operable program or batch file.
1

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.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.