medusajs / b2b-starter-medusa

Official Medusa B2B Starter template. Features common B2B ecommerce requirements and can be easily adapted and extended.
https://dub.sh/medusa-b2b-starter
MIT License
140 stars 37 forks source link

README: incorrect setup instructions #69

Closed earmellin closed 4 weeks ago

earmellin commented 1 month ago

Hello, I'm trying your starter but if I run:

yarn install && yarn setup

as indicated I get an error message:

Usage Error: Couldn't find a script named "setup".

and I actually don't see any setup scripts defined in the package.json

vladutstoica commented 1 month ago

Hi @earmellin,

Ensure you're working on the default branch, which is develop for now. Also, be sure to pull the latest updates from that branch.

earmellin commented 1 month ago

@vladutstoica I've switched to develop and pulled the latest updates committed yesterday, but the error is the same

mk0y commented 1 month ago

I have the following error when running yarn setup:

? Enter the database name my-db
error:   Unable to establish database connection because of the following error
error:   SASL: SCRAM-SERVER-FIRST-MESSAGE: client password must be a string
Error: SASL: SCRAM-SERVER-FIRST-MESSAGE: client password must be a string

I think the problem might be that setup overwrites .env file with DB_NAME=medusa-backend, even when i put "my-db" in the prompt. Because when i open it i see it was changed back to "medusa-backend".

mk0y commented 4 weeks ago

I was missing password in the database url... It was like this by default, but it lacks password ":postgres":

DATABASE_URL=postgres://postgres@localhost/$DB_NAME
earmellin commented 4 weeks ago

ok it works, I misunderstood the point where yarn setup should be launched, my mistake sorry :( just a suggestion: it would be useful to be able to indicate the port of the PostgreSQL server in addition to the name of the db in the setup procedure

vladutstoica commented 4 weeks ago

just a suggestion: it would be useful to be able to indicate the port of the PostgreSQL server in addition to the name of the db in the setup procedure

You can do this by appending :PORT_NUMBER to the DATABASE_URL environment variable, like so: postgres://postgres@localhost:5432.

The format should be: postgres://[user[:password]@][host][:port][/dbname].

earmellin commented 4 weeks ago

Yes indeed, looking in the code for the dbname variable I had gone to modify that url to install the environment. Maybe at the initial setup level a parameter also for the port would be more practical, just a suggestion. Thanks for your work!