npm install --global create-dmg fails
skylersaleh opened this issue · comments
Hi recently the github macos-12 and macos-latest (Ventura) runner started being unable to install create-dmg through npm install --global create-dmg
. Is there any pointers on how to resolve this?
You can see the full log files here:
https://github.com/skylersaleh/SkyEmu/actions/runs/6950200288/job/18909892876
And the relevant workflow file here:
This seems to be the relevant portion of the log indicating the failure:
npm ERR! code 1
npm ERR! path /usr/local/lib/node_modules/create-dmg/node_modules/macos-alias
npm ERR! command failed
npm ERR! command sh -c node-gyp rebuild
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@9.4.0
npm ERR! gyp info using node@18.18.2 | darwin | x64
npm ERR! gyp info find Python using Python version 3.12.0 found at "/usr/local/bin/python3"
npm ERR! gyp http GET https://nodejs.org/download/release/v18.18.2/node-v18.18.2-headers.tar.gz
npm ERR! gyp http 200 https://nodejs.org/download/release/v18.18.2/node-v18.18.2-headers.tar.gz
npm ERR! gyp http GET https://nodejs.org/download/release/v18.18.2/SHASUMS256.txt
npm ERR! gyp http 200 https://nodejs.org/download/release/v18.18.2/SHASUMS256.txt
npm ERR! gyp info spawn /usr/local/bin/python3
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args '/usr/local/Cellar/node@18/18.18.2/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
npm ERR! gyp info spawn args 'binding.gyp',
npm ERR! gyp info spawn args '-f',
npm ERR! gyp info spawn args 'make',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/usr/local/lib/node_modules/create-dmg/node_modules/macos-alias/build/config.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/usr/local/Cellar/node@18/18.18.2/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/Users/runner/Library/Caches/node-gyp/18.18.2/include/node/common.gypi',
npm ERR! gyp info spawn args '-Dlibrary=shared_library',
npm ERR! gyp info spawn args '-Dvisibility=default',
npm ERR! gyp info spawn args '-Dnode_root_dir=/Users/runner/Library/Caches/node-gyp/18.18.2',
npm ERR! gyp info spawn args '-Dnode_gyp_dir=/usr/local/Cellar/node@18/18.18.2/lib/node_modules/npm/node_modules/node-gyp',
npm ERR! gyp info spawn args '-Dnode_lib_file=/Users/runner/Library/Caches/node-gyp/18.18.2/<(target_arch)/node.lib',
npm ERR! gyp info spawn args '-Dmodule_root_dir=/usr/local/lib/node_modules/create-dmg/node_modules/macos-alias',
npm ERR! gyp info spawn args '-Dnode_engine=v8',
npm ERR! gyp info spawn args '--depth=.',
npm ERR! gyp info spawn args '--no-parallel',
npm ERR! gyp info spawn args '--generator-output',
npm ERR! gyp info spawn args 'build',
npm ERR! gyp info spawn args '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! Traceback (most recent call last):
npm ERR! File "/usr/local/Cellar/node@18/18.18.2/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py", line 42, in <module>
npm ERR! import gyp # noqa: E402
npm ERR! ^^^^^^^^^^
npm ERR! File "/usr/local/Cellar/node@18/18.18.2/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 9, in <module>
npm ERR! import gyp.input
npm ERR! File "/usr/local/Cellar/node@18/18.18.2/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 19, in <module>
npm ERR! from distutils.version import StrictVersion
npm ERR! ModuleNotFoundError: No module named 'distutils'
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: `gyp` failed with exit code: 1
npm ERR! gyp ERR! stack at ChildProcess.onCpExit (/usr/local/Cellar/node@18/18.18.2/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:325:16)
npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:517:28)
npm ERR! gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:292:12)
npm ERR! gyp ERR! System Darwin 21.6.0
npm ERR! gyp ERR! command "/usr/local/Cellar/node@18/18.18.2/bin/node" "/usr/local/Cellar/node@18/18.18.2/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd /usr/local/lib/node_modules/create-dmg/node_modules/macos-alias
npm ERR! gyp ERR! node -v v18.18.2
npm ERR! gyp ERR! node-gyp -v v9.4.0
npm ERR! gyp ERR! not ok
npm ERR! A complete log of this run can be found in: /Users/runner/.npm/_logs/2023-11-21T22_29_11_219Z-debug-0.log
Error: Process completed with exit code 1.
I found a temporary solution in additionally installing setuptools through pip. Which would change the install directions to the following.
brew install graphicsmagick imagemagick
pip install setuptools
npm install --global create-dmg
It looks like this is caused by distutils being moved out of the python standard library and into a separate setuptools library.
The error is coming from a dependency, not this package.