openshiporg / openship

multi-channel fulfillment at scale
https://openship.org
GNU Affero General Public License v3.0
1.04k stars 75 forks source link

there is an error during yarn dev #16

Closed selectbook closed 10 months ago

selectbook commented 10 months ago

the error log is bellow:

yarn run v1.22.21 $ yarn migrate && next dev $ keystone prisma migrate deploy Your Prisma and GraphQL schemas are not up to date error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command

junaid33 commented 10 months ago

Have you taken the latest pull? The prisma schema had been changed and the file not updated. It seems to be working for me locally with a fresh pull.

selectbook commented 10 months ago

This error occurred because I forgot to replace DATABASE_URL with my postgres connection string I have replaced, but there is another error:

yarn run v1.22.21
$ yarn migrate && next dev
$ keystone prisma migrate deploy
error Command failed with exit code 1.t up to date
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Have you taken the latest pull? The prisma schema had been changed and the file not updated. It seems to be working for me locally with a fresh pull.

junaid33 commented 10 months ago

Hmmm... looks like the migration is not being applied to the database. Do you have the specific log and error? What is your Node version? Openship needed a dependency that still uses Node 18 so Node 20 doesn't work just yet. Also, please verify your postgres database URL and make sure the table is empty.

selectbook commented 10 months ago

Hmmm... looks like the migration is not being applied to the database. Do you have the specific log and error? What is your Node version? Openship needed a dependency that still uses Node 18 so Node 20 doesn't work just yet. Also, please verify your postgres database URL and make sure the table is empty.

all logs are:

D:\project\openship>yarn dev
yarn run v1.22.21
$ yarn migrate && next dev
$ keystone prisma migrate deploy
Your Prisma and GraphQL schemas are not up to date
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

D:\project\openship>node -v
v18.19.0

D:\project\openship>

And the node version is 18.19.0. The database DATABASE_URL is DATABASE_URL=postgresql://root:Le@20230823@127.0.0.1:5432/openship Is thre anything wrong?

junaid33 commented 10 months ago

I'm using yarn run v1.22.4. Could you update yarn to that version and try? Also, can you try with a online hosted postgres database? https://neon.tech/ lets you get a free database. Maybe you can try using that URI string with yarn dev. Also, I'm on Node 18.18.2 but don't think that should be an issue.

selectbook commented 10 months ago

ok, solved. It's because the DATABASE_URL is wrong.