Skip to content

Commit

Permalink
Upgrade node-gyp package to fix Python 3.12 issue (#969)
Browse files Browse the repository at this point in the history
Fix an issue for Python 3.12 and node-gyp where node-gyp relies on the
"distutils" package in Python, which was removed in 3.12.

It resulted in this error upon install:

```
Traceback (most recent call last):
  File "/Users/tombruijn/appsignal/nodejs/node_modules/node-gyp/gyp/gyp_main.py", line 42, in <module>
    import gyp  # noqa: E402
    ^^^^^^^^^^
  File "/Users/tombruijn/appsignal/nodejs/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 9, in <module>
    import gyp.input
  File "/Users/tombruijn/appsignal/nodejs/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 19, in <module>
    from distutils.version import StrictVersion
ModuleNotFoundError: No module named 'distutils'
```

Upgrade node-gyp to resolve this issue.

Related issue in node-gyp:
nodejs/node-gyp#2869
  • Loading branch information
tombruijn authored Dec 6, 2023
1 parent 72e9e73 commit 96b8545
Show file tree
Hide file tree
Showing 3 changed files with 938 additions and 580 deletions.
6 changes: 6 additions & 0 deletions .changesets/upgrade-node-gyp-dependency.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
bump: "patch"
type: "fix"
---

Fix compatibility issue with Node.js's node-gyp package and Python 3.12.0. Python 3.12.0 removed a package called "distutils", causing the extension to fail to install. Upgrade the node-gyp package with the fix for this issue.
Loading

0 comments on commit 96b8545

Please sign in to comment.