mfts / papermark

Papermark is the open-source DocSend alternative with built-in analytics and custom domains.
https://papermark.io
GNU Affero General Public License v3.0
5.02k stars 689 forks source link

Installation failure - npx prisma db deploy gives "Unknown command" #310

Closed itacasoft closed 7 months ago

itacasoft commented 7 months ago

Trying to install it on Windows 10, when I try to run the npx command:

_npx db prisma deploy_

it returns:

_! Unknown command "deploy"

Manage your database schema and lifecycle during development.

Usage

$ prisma db [command] [options]

Options

-h, --help Display this help message --schema Custom path to your Prisma schema

Commands pull Pull the state from the database to the Prisma schema using introspection push Push the state from Prisma schema to the database during prototyping seed Seed your database execute Execute native commands to your database_

I should add the version of npm and npx program is 10.2.4:

_C:\usr\Projects\papermark>npm -v 10.2.4

C:\usr\Projects\papermark>npx -v 10.2.4__

Any hint how to proceed? Thanks

ashrafchowdury commented 7 months ago

Hay @itacasoft, I think you made a mistake. It's not npx db prisma deploy it's npx prisma db deploy

Try out this:

npx prisma db deploy

If that's not working then try this, please let me know if all of them are working or not.

npx prisma db push
itacasoft commented 7 months ago

Apologize, I did issue the command

_npx prima db deploy_

and the result is "Unknown command". However I tried also with the push command, with no luck either:

_C:\usr\Projects\papermark>npx prisma db push Environment variables loaded from .env Prisma schema loaded from prisma\schema.prisma Datasource "db": PostgreSQL database

Error: Prisma schema validation - (get-config wasm) Error code: P1012 error: Error validating datasource db: You must provide a nonempty direct URL. The environment variable POSTGRES_PRISMA_URL_NON_POOLING resolved to an empty string. --> schema.prisma:4 3 url = env("POSTGRES_PRISMA_URL") // uses connection pooling 4 directUrl = env("POSTGRES_PRISMA_URL_NON_POOLING") // uses a direct connection

Validation Error Count: 1 [Context: getConfig]

Prisma CLI Version : 5.9.1_

ashrafchowdury commented 7 months ago

Have you setup this env variable POSTGRES_PRISMA_URL_NON_POOLING=

if not then add this POSTGRES_PRISMA_URL_NON_POOLING= environment variable to your .env file. The value of this env variable is going to same as this POSTGRES_URL_NON_POOLING= env variable.

itacasoft commented 7 months ago

I finally managed to overcome the database connection issue.

I suggest to add the following to the Getting Started section:

itacasoft commented 7 months ago

Now, when issuing the command

_npm run dev_

I encounter the following error message:

C:\usr\Projects\papermark>npm run dev

papermark@0.1.0 dev next dev

▲ Next.js 14.1.0

Please help, thx

ashrafchowdury commented 7 months ago

Don't know exactly why it's happening, I guess something is wrong with your system.

Reinstalling npm packages can resolve this issue:

rm -rf node_modules
npm i

Otherwise if it's not working then share your basic operating system info so that I can assist you better.

itacasoft commented 7 months ago

Thank you @ashrafchowdury , I reached a page that was suggesting the same and it worked.

Now, web application starts, but when I try to register on page http://localhost:3000/login, apparently it works, but actually no email is sent. I registered on Resend with a free plan and set the RESEND_API_KEY value in the .env environment with the API Key copied from Resend web site, but I did not receive any email.

image_2024-02-27_153952263

For information, I installed everything on my laptop connected to internet through my home WiFi, but I tried also hotspot of my mobile phone with no success.

Thanks in advance for any help.

Any suggestion?

ashrafchowdury commented 7 months ago

You have to run the email server to get to login.

Run the email server by using:

npm run email
itacasoft commented 7 months ago

log_20240227.txt

ok. I have run "npm run email" on a CMD prompt, and "npm run dev" on another CMD prompt. Now, trying to register give me a better understandable error:

Untitled1

See also the log file.

What's next? Thx

mfts commented 7 months ago

Hey @itacasoft

I apologize. There's an error in the readme.

It should be

npx prisma migrate deploy

Hope that helps

itacasoft commented 7 months ago

Thank you @mfts and @ashrafchowdury , but I still have problem sending emails. However, since the Prisma part is OK and the web server starts and responds, I would close the issue related to the installation and db deploy and open an issue related to email. Thanks all for your support.