cube icon indicating copy to clipboard operation
cube copied to clipboard

(peer dependencies) Install @cubejs-backend/postgres-driver failed

Open mokeyish opened this issue 1 year ago β€’ 5 comments

Describe the bug

Install @cubejs-backend/postgres-driver failed.

It seems to be a peer dependencies version conflict issue.

To Reproduce Steps to reproduce the behavior:

  1. Docker run

    docker run -p 4000:4000 \
      -p 15432:15432 \
      -v ${PWD}:/cube/conf \
      -e CUBEJS_DEV_MODE=true \
      cubejs/cube:dev
    
  2. Open http://127.0.0.1:4000

  3. Set Up a Database connection

  4. Install postgres-driver

    image
  5. See error

    image

    npm install @cubejs-backend/postgres-driver --save-dev failed with exit code 1. Please check your console.

Expected behavior Install postgres-driver successfully.

Screenshots

image

image

Version: v0.35.72(latestοΌ‰

Additional context

Seeing pnpm dealing with this kind of problem is smoother.

https://pnpm.io/how-peers-are-resolved

mokeyish avatar Aug 20 '24 03:08 mokeyish

Hi @mokeyish πŸ‘‹

Install postgres

What do you mean by that, exactly? It would be great to get more details.

I have just went through the steps described here and everything worked smoothly. I did not have to install any Postgres driver though as it's bundled with Cube in its Docker container.

igorlukanin avatar Aug 20 '24 14:08 igorlukanin

@igorlukanin I've update the Step To Reproduce with screenshot.

mokeyish avatar Aug 21 '24 02:08 mokeyish

My temporary solution is creating a directory with following structure

cubework
β”œβ”€β”€ justfile
β”œβ”€β”€ package.json
  1. package.json, copy from https://github.com/cube-js/cube/blob/master/packages/cubejs-docker/package.json

  2. justfile

    export PATH := absolute_path("node_modules/.bin:") + env_var("PATH")
    
    export CUBEJS_DEV_MODE := "true"
    
    setup:
        pnpm install
    
    serve:
        cubejs server
    
    
    cleanup:
        rm -rf .cubestore
        rm -rf .env
        rm -rf model
    
  3. startup

    1. install just https://just.systems/man/en/chapter_4.html
    2. install pnpm https://pnpm.io/installation
    3. just setup
    4. just serve
    5. open http://127.0.0.1:4000/

mokeyish avatar Aug 21 '24 02:08 mokeyish

Does this only happen with the dev image? Could you please try latest?

igorlukanin avatar Aug 21 '24 09:08 igorlukanin

Does this only happen with the dev image? Could you please try latest?

With the latest tag, npm install @cubejs-backend/postgres-driver is long time no response. I also tried other npm registry mirror, the same is true.

mokeyish avatar Aug 21 '24 10:08 mokeyish

Hopefully it can be migrated to use pnpm or configured to use pnpm.

mokeyish avatar Aug 28 '24 13:08 mokeyish

Hi @mokeyish πŸ‘‹

Here's what I mentioned in one of my previous messaged:

I did not have to install any Postgres driver though as it's bundled with Cube in its Docker container.

Here's what you responded:

I've update the Step To Reproduce with screenshot.

However, I still don't understand what do you mean by "step 4 β€” Install postgres-driver" and why do you need to do that at all. After "step 3 β€” Set Up a Database connection", if that is a Postgres database, you will have a working connection, no driver installation required.

I'm afraid I'll need more details from you to understand what is the issue. If you can record a video where you follow the steps that you've described, that would be helpful.

igorlukanin avatar Aug 29 '24 15:08 igorlukanin

Closing due to inactivity. Please feel free to reopen.

igorlukanin avatar Nov 12 '24 10:11 igorlukanin