5

I have a node.js project with prisma as ORM that connects to postgresdb. After I installed dependencies with yarn install I tried to run command npx prisma generate then I got error stating

Unable to require(/node_modules/prisma/libquery_engine-debian-openssl-1.1.x.so.node) libssl.so.1.1: cannot open shared object file: No such file or directory.

local setup

I have ubuntu 22.04 with node version of v16.14.2.

3 Answers 3

5

It seems there is an issue with the version of OpenSSL installed on your machine. You might need to (re)install OpenSSL.

I suggest you create an issue on prisma/prisma

We have a few issues about this here and the solution is often specific to the configuration.

Sign up to request clarification or add additional context in comments.

1 Comment

I tried changing my base container image from node-18:slim (which uses debian bookworm) and after a deeper check turns out it doesn't have openssl installed, changing base image to alpine solves the issue
1

You would need to add an option of binaryTargets in generator block in your schema.prisma file as mentioned in docs.

Adding debian-openssl-1.1.x to your generator should solve your issue.

generator client {
  provider      = "prisma-client-js"
  binaryTargets = ["debian-openssl-1.1.x"]
}

1 Comment

This should not be needed, though. The error already shows that the correct engine is downloaded: "libquery_engine-debian-openssl-1.1.x.so.node"
0

For others who also run into this error when using bun I was using bun + prisma and trying to get to deploy on railway

I ended up not able to get to work with nixpack but I did get it to work with docker

FROM oven/bun:1.1.20

WORKDIR /app

# Install OpenSSL and required dependencies
RUN apt-get update && apt-get install -y \
    openssl \
    libssl1.1 \
    libssl-dev \
    ca-certificates \
    && rm -rf /var/lib/apt/lists/*

# Copy application files
COPY . .

# Install dependencies
RUN bun install

# Generate Prisma Client
RUN bunx prisma generate

# Start the application
CMD ["bun", "run", "start"] 

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.