cube-js / cube

📊 Cube — The Semantic Layer for Building Data Applications
https://cube.dev
Other
17.93k stars 1.78k forks source link

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

Open mokeyish opened 2 months ago

mokeyish commented 2 months ago

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

igorlukanin commented 2 months ago

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.

mokeyish commented 2 months ago

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

mokeyish commented 2 months ago

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/
igorlukanin commented 2 months ago

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

mokeyish commented 2 months ago

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 commented 2 months ago

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

igorlukanin commented 2 months ago

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.