Prisma generate randomly fails on Ubuntu due to missing internal .so `libquery_engine-debian-openssl-1.1.x.so.node`
Problem
Bug description Here is my package.json in the root of my repo: [code block] I have two database packages with `prisma-generate` scripts that look like so: [code block] In my GitHub actions, when I run `pnpm install`, I randomly (and only sometimes) get the following error: [code block] How to reproduce See above. Can't consistently reproduce Expected behavior No errors Prisma information See above Environment & setup - OS: `runs-on: ubuntu-latest` from my GH action - Database: PostgreSQL - Node.js version: `18.12.1` Prisma Version [code block]
Error Output
Error: ENOENT: no such file or directory, stat '/home/runner/work/Ecominate/Ecominate/node_modules/.pnpm/prisma@4.13.0/node_modules/prisma/libquery_engine-debian-openssl-1.1.x.so.node'
Unverified for your environment
Select your OS to check compatibility.
1 Fix
Ensure Consistent Prisma Binary Generation on Ubuntu
The error occurs due to the Prisma CLI not generating the required native binaries consistently during the installation process, particularly on CI environments like GitHub Actions. This can happen if the installation process is interrupted or if the environment does not have the necessary build tools or dependencies installed.
Awaiting Verification
Be the first to verify this fix
- 1
Install Required Build Tools
Ensure that all necessary build tools and libraries are installed in the GitHub Actions environment to support the generation of Prisma binaries.
bashsudo apt-get update && sudo apt-get install -y build-essential libssl-dev - 2
Force Prisma Binary Generation
Modify the GitHub Actions workflow to explicitly run the Prisma generate command after installation to ensure that the binaries are generated correctly.
bashpnpm prisma generate - 3
Cache Node Modules
Implement caching for the node_modules directory in your GitHub Actions to prevent unnecessary installations and ensure that the binaries persist across runs.
yamlsteps: - name: Cache node modules uses: actions/cache@v2 with: path: node_modules key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} - 4
Check for Prisma Version Compatibility
Ensure that the Prisma version specified in your package.json is compatible with your Node.js version and the database you are using. Update Prisma if necessary.
bashpnpm update prisma
Validation
Run the GitHub Actions workflow again and ensure that the installation completes without errors. Verify that the Prisma binaries are generated correctly by checking for the presence of 'libquery_engine-debian-openssl-1.1.x.so.node' in the node_modules directory.
Sign in to verify this fix
Environment
Submitted by
Alex Chen
2450 rep