Skip to content

Dependency sharp cannot be installed on systems with python 3.13.5, prevents pnpm install #4137

@ThisIsMissEm

Description

@ThisIsMissEm

Describe the bug

When attempting to install dependencies of this repository on a system running python >= 3.12, the pnpm install crashes with the following:

$ pnpm install                                                               fix/4136-support-multiple-redirect-uris*
Scope: all 49 workspace projects
 WARN  There are cyclic workspace dependencies: [redacted]/atproto/packages/bsky, [redacted]/atproto/packages/pds
packages/aws                             |  WARN  deprecated @aws-sdk/[email protected]
 WARN  5 deprecated subdependencies found: @npmcli/[email protected], [email protected], [email protected], [email protected], [email protected]
Packages: +1822
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Progress: resolved 1966, reused 1816, downloaded 0, added 0, done
node_modules/.pnpm/[email protected]/node_modules/sharp: Running install script, failed in 2.1s
.../[email protected]/node_modules/sharp install$ node install/check.js
│ sharp: Detected globally-installed libvips v8.17.1
│ sharp: Attempting to build from source via node-gyp
│ sharp: Found node-addon-api 
│ sharp: Found node-gyp 9.3.1
│ sharp: See https://sharp.pixelplumbing.com/install#building-from-source
│ gyp info it worked if it ends with ok
│ gyp info using [email protected]
│ gyp info using [email protected] | darwin | arm64
│ gyp info chdir src
│ gyp info find Python using Python version 3.13.3 found at "[redacted]/.pyenv/versions/3.13.3/bin/python3"
│ gyp info spawn [redacted]/.pyenv/versions/3.13.3/bin/python3
│ gyp info spawn args [
│ gyp info spawn args   '[redacted]/.cache/node/corepack/v1/pnpm/8.15.9/dist/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   '[redacted]/atproto/node_modules/.pnpm/[email protected]/no…
│ gyp info spawn args   '-I',
│ gyp info spawn args   '[redacted]/.cache/node/corepack/v1/pnpm/8.15.9/dist/node_modules/node-gyp/addon.gypi',
│ gyp info spawn args   '-I',
│ gyp info spawn args   '[redacted]/Library/Caches/node-gyp/18.20.8/include/node/common.gypi',
│ gyp info spawn args   '-Dlibrary=shared_library',
│ gyp info spawn args   '-Dvisibility=default',
│ gyp info spawn args   '-Dnode_root_dir=[redacted]/Library/Caches/node-gyp/18.20.8',
│ gyp info spawn args   '-Dnode_gyp_dir=[redacted]/.cache/node/corepack/v1/pnpm/8.15.9/dist/node_modules/node-gyp',
│ gyp info spawn args   '-Dnode_lib_file=[redacted]/Library/Caches/node-gyp/18.20.8/<(target_arch)/node.lib',
│ gyp info spawn args   '-Dmodule_root_dir=[redacted]/atproto/node_modules/.pn…
│ 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 ]
│ Traceback (most recent call last):
│   File "[redacted]/.cache/node/corepack/v1/pnpm/8.15.9/dist/node_modules/node-gyp/gyp/gyp_main.py", line 42, in <modul…
│     import gyp  # noqa: E402
│     ^^^^^^^^^^
│   File "[redacted]/.cache/node/corepack/v1/pnpm/8.15.9/dist/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 9, …
│     import gyp.input
│   File "[redacted]/.cache/node/corepack/v1/pnpm/8.15.9/dist/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 19, in…
│     from distutils.version import StrictVersion
│ ModuleNotFoundError: No module named 'distutils'
│ gyp ERR! configure error 
│ gyp ERR! stack Error: `gyp` failed with exit code: 1
│ gyp ERR! stack     at ChildProcess.onCpExit ([redacted]/.cache/node/corepack/v1/pnpm/8.15.9/dist/node_modules/node-gyp…
│ gyp ERR! stack     at ChildProcess.emit (node:events:517:28)
│ gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:292:12)
│ gyp ERR! System Darwin 24.6.0
│ gyp ERR! command "[redacted]/Library/Application Support/fnm/node-versions/v18.20.8/installation/bin/node" "[redacted]…
│ gyp ERR! cwd [redacted]/atproto/node_modules/.pnpm/[email protected]/node_modules…
│ gyp ERR! node -v v18.20.8
│ gyp ERR! node-gyp -v v9.4.1
│ gyp ERR! not ok 
└─ Failed in 2.1s at [redacted]/atproto/node_modules/.pnpm/[email protected]/node_modules/sharp
 ELIFECYCLE  Command failed with exit code 1.

This error is because the version of node-gyp being used does not support python 3.12+: https://www.npmjs.com/package/node-gyp/v/9.3.1

The latest version of node-gyp (11.4.2) has the following requirements:

Python >= v3.12 requires node-gyp >= v10

https://www.npmjs.com/package/node-gyp

To Reproduce

Steps to reproduce the behavior:

  1. Have python 3.12+ in your local environment as python
  2. pnpm install

Expected behavior

Installation should complete fine.

Details

  • Operating system: macOS Sequoia
  • Node version: 18.20.8 (per nvmrc in this repo, note: node.js 18 is EOL)

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions