Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ModuleNotFoundError: No module named 'distutils' on Vercel starting from version 4.8.0 #477

Closed
baptisteArno opened this issue Jun 4, 2024 · 3 comments

Comments

@baptisteArno
Copy link

Starting from version 4.8.0, isolated-vm can't be installed on Vercel.

The error is:

.../node_modules/isolated-vm install: gyp http GET https://nodejs.org/download/release/v20.12.2/SHASUMS256.txt
16:47:11.912 | .../node_modules/isolated-vm install: gyp http 200 https://nodejs.org/download/release/v20.12.2/SHASUMS256.txt
16:47:11.920 | .../node_modules/isolated-vm install: gyp info spawn /usr/local/bin/python3
16:47:11.923 | .../node_modules/isolated-vm install: gyp info spawn args [
16:47:11.923 | .../node_modules/isolated-vm install: gyp info spawn args   '/pnpm8/node_modules/pnpm/dist/node_modules/node-gyp/gyp/gyp_main.py',
16:47:11.924 | .../node_modules/isolated-vm install: gyp info spawn args   'binding.gyp',
16:47:11.924 | .../node_modules/isolated-vm install: gyp info spawn args   '-f',
16:47:11.924 | .../node_modules/isolated-vm install: gyp info spawn args   'make',
16:47:11.924 | .../node_modules/isolated-vm install: gyp info spawn args   '-I',
16:47:11.924 | .../node_modules/isolated-vm install: gyp info spawn args   '/vercel/path0/node_modules/.pnpm/isolated-vm@5.0.0/node_modules/isolated-vm/build/config.gypi',
16:47:11.924 | .../node_modules/isolated-vm install: gyp info spawn args   '-I',
16:47:11.924 | .../node_modules/isolated-vm install: gyp info spawn args   '/pnpm8/node_modules/pnpm/dist/node_modules/node-gyp/addon.gypi',
16:47:11.924 | .../node_modules/isolated-vm install: gyp info spawn args   '-I',
16:47:11.924 | .../node_modules/isolated-vm install: gyp info spawn args   '/vercel/.cache/node-gyp/20.12.2/include/node/common.gypi',
16:47:11.924 | .../node_modules/isolated-vm install: gyp info spawn args   '-Dlibrary=shared_library',
16:47:11.925 | .../node_modules/isolated-vm install: gyp info spawn args   '-Dvisibility=default',
16:47:11.925 | .../node_modules/isolated-vm install: gyp info spawn args   '-Dnode_root_dir=/vercel/.cache/node-gyp/20.12.2',
16:47:11.925 | .../node_modules/isolated-vm install: gyp info spawn args   '-Dnode_gyp_dir=/pnpm8/node_modules/pnpm/dist/node_modules/node-gyp',
16:47:11.925 | .../node_modules/isolated-vm install: gyp info spawn args   '-Dnode_lib_file=/vercel/.cache/node-gyp/20.12.2/<(target_arch)/node.lib',
16:47:11.925 | .../node_modules/isolated-vm install: gyp info spawn args   '-Dmodule_root_dir=/vercel/path0/node_modules/.pnpm/isolated-vm@5.0.0/node_modules/isolated-vm',
16:47:11.925 | .../node_modules/isolated-vm install: gyp info spawn args   '-Dnode_engine=v8',
16:47:11.925 | .../node_modules/isolated-vm install: gyp info spawn args   '--depth=.',
16:47:11.925 | .../node_modules/isolated-vm install: gyp info spawn args   '--no-parallel',
16:47:11.925 | .../node_modules/isolated-vm install: gyp info spawn args   '--generator-output',
16:47:11.925 | .../node_modules/isolated-vm install: gyp info spawn args   'build',
16:47:11.925 | .../node_modules/isolated-vm install: gyp info spawn args   '-Goutput_dir=.'
16:47:11.925 | .../node_modules/isolated-vm install: gyp info spawn args ]
16:47:12.023 | .../node_modules/isolated-vm install: Traceback (most recent call last):
16:47:12.024 | .../node_modules/isolated-vm install:   File "/pnpm8/node_modules/pnpm/dist/node_modules/node-gyp/gyp/gyp_main.py", line 42, in <module>
16:47:12.024 | .../node_modules/isolated-vm install:     import gyp  # noqa: E402
16:47:12.024 | .../node_modules/isolated-vm install:     ^^^^^^^^^^
16:47:12.024 | .../node_modules/isolated-vm install:   File "/pnpm8/node_modules/pnpm/dist/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 9, in <module>
16:47:12.024 | .../node_modules/isolated-vm install:     import gyp.input
16:47:12.024 | .../node_modules/isolated-vm install:   File "/pnpm8/node_modules/pnpm/dist/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 19, in <module>
16:47:12.024 | .../node_modules/isolated-vm install:     from distutils.version import StrictVersion
16:47:12.024 | .../node_modules/isolated-vm install: ModuleNotFoundError: No module named 'distutils'
16:47:12.032 | .../node_modules/isolated-vm install: gyp ERR! configure error
16:47:12.033 | .../node_modules/isolated-vm install: gyp ERR! stack Error: `gyp` failed with exit code: 1
16:47:12.033 | .../node_modules/isolated-vm install: gyp ERR! stack     at ChildProcess.onCpExit (/pnpm8/node_modules/pnpm/dist/node_modules/node-gyp/lib/configure.js:325:16)
16:47:12.033 | .../node_modules/isolated-vm install: gyp ERR! stack     at ChildProcess.emit (node:events:518:28)
16:47:12.033 | .../node_modules/isolated-vm install: gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:294:12)
16:47:12.033 | .../node_modules/isolated-vm install: gyp ERR! System Linux 5.10.174
16:47:12.033 | .../node_modules/isolated-vm install: gyp ERR! command "/node20/bin/node" "/pnpm8/node_modules/pnpm/dist/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--release" "-j" "max"
16:47:12.034 | .../node_modules/isolated-vm install: gyp ERR! cwd /vercel/path0/node_modules/.pnpm/isolated-vm@5.0.0/node_modules/isolated-vm
16:47:12.034 | .../node_modules/isolated-vm install: gyp ERR! node -v v20.12.2
16:47:12.034 | .../node_modules/isolated-vm install: gyp ERR! node-gyp -v v9.4.1
16:47:12.034 | .../node_modules/isolated-vm install: gyp ERR! not ok
16:47:12.041 | .../node_modules/isolated-vm install: Failed
16:47:12.043 | ELIFECYCLE  Command failed with exit code 1.
16:47:12.113 | Error: Command "pnpm install" exited with 1
16:47:13.087

<br class="Apple-interchange-newline">

Suspected commit: ac5fbde

@kuon
Copy link

kuon commented Jun 4, 2024

I think distutils was deprecated with python 3.10 and was removed with python 3.12. It seems weird that they removed the setuptool install step in the highlighted commit which was added to fix the issue. But also it is in a github workflow, so I am not sure if it is actually used.

@baptisteArno
Copy link
Author

I think distutils was deprecated with python 3.10 and was removed with python 3.12. It seems weird that they removed the setuptool install step in the highlighted commit which was added to fix the issue. But also it is in a github workflow, so I am not sure if it is actually used.

It is used, the script is building the binary that is used in post install script if I am correct!

@laverdet
Copy link
Owner

The binaries for v4.8.0 are broken. I recommend v5.0.1 which is the same as v4.x except it no longer supports nodejs v16

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants