Skip to content

Error installing dependencies when contributing #4219

Closed
@muxahuk

Description

Bug description

Getting an error when trying to follow "CONTRIBUTING.md" on "pnpm i" step

Console output
workplace@workplace-VirtualBox:~/WebstormProjects/prisma/src$ pnpm i
Scope: all 11 workspace projects
Lockfile is up-to-date, resolution step is skipped
. preinstall$ node -e "!process.env.npm_config_user_agent.startsWith('pnpm/') && !console.log('Use pnpm install to install dependencies in this repository\n') && process.exit(1)"
└─ Done in 66ms
packages/cli preinstall$ node scripts/preinstall-entry.js
└─ Done in 52ms
Packages: +1199
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Packages are hard linked from the content-addressable store to the virtual store.
Content-addressable store is at: /home/workplace/.pnpm-store/v3
Virtual store is at:             node_modules/.pnpm
Progress: resolved 1199, reused 1198, downloaded 1, added 1199, done
node_modules/.pnpm/@prisma/engines@2.11.2-9-a624a6628b9e5e453bb8f8cb0460e233a3a97e62/node_modules/@prisma/engines: Running postinstall script, done in 2s
node_modules/.pnpm/esbuild@0.8.3/node_modules/esbuild: Running postinstall script, done in 199ms
node_modules/.pnpm/@prisma/engines@2.11.0-10.58369335532e47bdcec77a2f1e7c1fb83a463918/node_modules/@prisma/engines: Running postinstall script, done in 2s
node_modules/.pnpm/husky@4.3.0/node_modules/husky: Running install script, done in 1s
node_modules/.pnpm/sqlite3@4.2.0/node_modules/sqlite3: Running install script, failed in 4s
.../sqlite3@4.2.0/node_modules/sqlite3 install$ node-pre-gyp install --fallback-to-build
│ node-pre-gyp info it worked if it ends with ok
│ node-pre-gyp info using node-pre-gyp@0.11.0
│ node-pre-gyp info using node@15.1.0 | linux | x64
│ node-pre-gyp WARN Using request for node-pre-gyp https download 
│ node-pre-gyp info check checked for "/home/workplace/WebstormProjects/prisma/src/node_modules/.pnpm/sqlite3@4.2.0/node_modules/sqlite3/lib/binding/node-v88-linux-x64/node_sqlite3.node" (not found)
│ node-pre-gyp http GET https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v4.2.0/node-v88-linux-x64.tar.gz
│ node-pre-gyp http 403 https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v4.2.0/node-v88-linux-x64.tar.gz
│ node-pre-gyp WARN Tried to download(403): https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v4.2.0/node-v88-linux-x64.tar.gz 
│ node-pre-gyp WARN Pre-built binaries not found for sqlite3@4.2.0 and node@15.1.0 (node-v88 ABI, glibc) (falling back to source compile with node-gyp) 
│ node-pre-gyp http 403 status code downloading tarball https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v4.2.0/node-v88-linux-x64.tar.gz 
│ gyp info it worked if it ends with ok
│ gyp info using node-gyp@7.1.2
│ gyp info using node@15.1.0 | linux | x64
│ gyp info ok 
│ gyp info it worked if it ends with ok
│ gyp info using node-gyp@7.1.2
│ gyp info using node@15.1.0 | linux | x64
│ gyp info find Python using Python version 3.8.5 found at "/usr/bin/python3"
│ gyp info spawn /usr/bin/python3
│ gyp info spawn args [
│ gyp info spawn args   '/home/workplace/.nvm/versions/node/v15.1.0/lib/node_modules/pnpm/lib/node_modules/node-gyp/gyp/gyp_main.py',
│ gyp info spawn args   'binding.gyp',
│ gyp info spawn args   '-f',
│ gyp info spawn args   'make',
│ gyp info spawn args   '-I',
│ gyp info spawn args   '/home/workplace/WebstormProjects/prisma/src/node_modules/.pnpm/sqlite3@4.2.0/node_modules/sqlite3/build/config.gypi',
│ gyp info spawn args   '-I',
│ gyp info spawn args   '/home/workplace/.nvm/versions/node/v15.1.0/lib/node_modules/pnpm/lib/node_modules/node-gyp/addon.gypi',
│ gyp info spawn args   '-I',
│ gyp info spawn args   '/home/workplace/.cache/node-gyp/15.1.0/include/node/common.gypi',
│ gyp info spawn args   '-Dlibrary=shared_library',
│ gyp info spawn args   '-Dvisibility=default',
│ gyp info spawn args   '-Dnode_root_dir=/home/workplace/.cache/node-gyp/15.1.0',
│ gyp info spawn args   '-Dnode_gyp_dir=/home/workplace/.nvm/versions/node/v15.1.0/lib/node_modules/pnpm/lib/node_modules/node-gyp',
│ gyp info spawn args   '-Dnode_lib_file=/home/workplace/.cache/node-gyp/15.1.0/<(target_arch)/node.lib',
│ gyp info spawn args   '-Dmodule_root_dir=/home/workplace/WebstormProjects/prisma/src/node_modules/.pnpm/sqlite3@4.2.0/node_modules/sqlite3',
│ gyp info spawn args   '-Dnode_engine=v8',
│ gyp info spawn args   '--depth=.',
│ gyp info spawn args   '--no-parallel',
│ gyp info spawn args   '--generator-output',
│ gyp info spawn args   'build',
│ gyp info spawn args   '-Goutput_dir=.'
│ gyp info spawn args ]
│ gyp info ok 
│ gyp info it worked if it ends with ok
│ gyp info using node-gyp@7.1.2
│ gyp info using node@15.1.0 | linux | x64
│ gyp info spawn make
│ gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
│ make: Entering directory '/home/workplace/WebstormProjects/prisma/src/node_modules/.pnpm/sqlite3@4.2.0/node_modules/sqlite3/build'
│   ACTION deps_sqlite3_gyp_action_before_build_target_unpack_sqlite_dep Release/obj/gen/sqlite-autoconf-3310100/sqlite3.c
│ /bin/sh: 1: python: not found
│ make: *** [deps/action_before_build.target.mk:13: Release/obj/gen/sqlite-autoconf-3310100/sqlite3.c] Error 127
│ make: Leaving directory '/home/workplace/WebstormProjects/prisma/src/node_modules/.pnpm/sqlite3@4.2.0/node_modules/sqlite3/build'
│ gyp ERR! build error 
│ gyp ERR! stack Error: `make` failed with exit code: 2
│ gyp ERR! stack     at ChildProcess.onExit (/home/workplace/.nvm/versions/node/v15.1.0/lib/node_modules/pnpm/lib/node_modules/node-gyp/lib/build.js:194:23)
│ gyp ERR! stack     at ChildProcess.emit (node:events:327:20)
│ gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:277:12)
│ gyp ERR! System Linux 5.4.0-52-generic
│ gyp ERR! command "/home/workplace/.nvm/versions/node/v15.1.0/bin/node" "/home/workplace/.nvm/versions/node/v15.1.0/lib/node_modules/pnpm/lib/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback
│ gyp ERR! cwd /home/workplace/WebstormProjects/prisma/src/node_modules/.pnpm/sqlite3@4.2.0/node_modules/sqlite3
│ gyp ERR! node -v v15.1.0
│ gyp ERR! node-gyp -v v7.1.2
│ gyp ERR! not ok 
│ node-pre-gyp ERR! build error 
│ node-pre-gyp ERR! stack Error: Failed to execute '/home/workplace/.nvm/versions/node/v15.1.0/bin/node /home/workplace/.nvm/versions/node/v15.1.0/lib/node_modules/pnpm/lib/node_modules/node-gyp/bin/no
│ node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/home/workplace/WebstormProjects/prisma/src/node_modules/.pnpm/node-pre-gyp@0.11.0/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
│ node-pre-gyp ERR! stack     at ChildProcess.emit (node:events:327:20)
│ node-pre-gyp ERR! stack     at maybeClose (node:internal/child_process:1055:16)
│ node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:288:5)
│ node-pre-gyp ERR! System Linux 5.4.0-52-generic
│ node-pre-gyp ERR! command "/home/workplace/.nvm/versions/node/v15.1.0/bin/node" "/home/workplace/WebstormProjects/prisma/src/node_modules/.pnpm/node-pre-gyp@0.11.0/node_modules/node-pre-gyp/bin/node-
│ node-pre-gyp ERR! cwd /home/workplace/WebstormProjects/prisma/src/node_modules/.pnpm/sqlite3@4.2.0/node_modules/sqlite3
│ node-pre-gyp ERR! node -v v15.1.0
│ node-pre-gyp ERR! node-pre-gyp -v v0.11.0
│ node-pre-gyp ERR! not ok 
│ Failed to execute '/home/workplace/.nvm/versions/node/v15.1.0/bin/node /home/workplace/.nvm/versions/node/v15.1.0/lib/node_modules/pnpm/lib/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-b
└─ Failed in 4s
node_modules/.pnpm/husky@4.3.0/node_modules/husky: Running postinstall script, done in 148ms
node_modules/.pnpm/sqlite3@5.0.0/node_modules/sqlite3: Running install script, done in 3s
 ERROR  Command failed with exit code 1.

The error happens because package "sqlite-async" uses sqlite3 version 4.2.0 as a dependency.
Same time "sqlite3@4.2.0" does not come with pre-build sqlite driver as it is in "sqlite3@5.0.0".
Meaning that npm tries to build sqlite and if you don't have necessary dependencies installed - it fails to complete "pnpm i" command.

How to reproduce

Consider using ubuntu 20

  1. sudo apt remove build-essential python-is-python3 && sudo apt autoremove - remove build tools that are required for "sqlite@4.2.0" to be build
  2. cd prisma/src
  3. rm -rf ./node_modules - remove node_modules as pnpm keeps cached build of sqlite3@4.2.0 there
  4. pnpm i
  5. See error

Expected behavior

There should not be error.

Environment & setup

  • OS: Ubuntu 20.04.1 LTS
  • Node.js version: v15.1.0
  • Npm version: 7.0.10
  • Prisma version: git master branch

Fix

There's already an MR into "sqlite-async" library - fhellwig/sqlite-async#8
That bumps version of "sqlite3" from "4.2.0" to "5.0.0"
So, once that merge request is merged and new version on "sqlite-async" is released "prisma" would need to update "sqlite-async" version.

Meanwhile in order to contribute you would need to install build-essential and python-is-python3 (if you don't have python and do have python3) packages on your system.

sudo apt install build-essential python-is-python3

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions