actions / runner-images

GitHub Actions runner images
MIT License
9.77k stars 2.99k forks source link

npm install fails on macos-14 #9613

Closed SandeshKR closed 5 months ago

SandeshKR commented 5 months ago

Description

With image macos-14 , it was working fine a week ago. Now I receive the below error in one of my github actions when running npm install. When I tested with image macos-13, it works fine.

When I check the image version of both macos-13 and macos-14, they both look same 2.314.1

npm WARN deprecated formidable@1.2.6: Please upgrade to latest, formidable@v2 or formidable@v3! Check these notes: https://bit.ly/2ZEqIau npm ERR! code 1 npm ERR! path /Users/runner/work//src/app/node_modules/leveldown npm ERR! command failed npm ERR! command sh -c -- node-gyp-build 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@16.20.2 | darwin | arm64 npm ERR! gyp info find Python using Python version 3.12.2 found at "/opt/homebrew/opt/python@3.12/bin/python3.12" npm ERR! gyp http GET https://nodejs.org/download/release/v16.20.2/node-v16.20.2-headers.tar.gz npm ERR! gyp http 200 https://nodejs.org/download/release/v16.20.2/node-v16.20.2-headers.tar.gz npm ERR! gyp http GET https://nodejs.org/download/release/v16.20.2/SHASUMS256.txt npm ERR! gyp http 200 https://nodejs.org/download/release/v16.20.2/SHASUMS256.txt npm ERR! gyp info spawn /opt/homebrew/opt/python@3.12/bin/python3.12 npm ERR! gyp info spawn args [ npm ERR! gyp info spawn args '/Users/runner/work//src/app/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 '/Users/runner/work/src/app/node_modules/leveldown/build/config.gypi', npm ERR! gyp info spawn args '-I', npm ERR! gyp info spawn args '/Users/runner/work//src/app/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/16.20.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/16.20.2', npm ERR! gyp info spawn args '-Dnode_gyp_dir=/Users/runner/work//src/app/node_modules/node-gyp', npm ERR! gyp info spawn args '-Dnode_lib_file=/Users/runner/Library/Caches/node-gyp/16.20.2/<(target_arch)/node.lib', npm ERR! gyp info spawn args '-Dmodule_root_dir=/Users/runner/work//src/app/node_modules/leveldown', 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 "/Users/runner/work//src/app/node_modules/node-gyp/gyp/gyp_main.py", line 42, in npm ERR! import gyp # noqa: E402 npm ERR! ^^^^^^^^^^ npm ERR! File "/Users/runner/work//src/app/node_modules/node-gyp/gyp/pylib/gyp/init.py", line 9, in npm ERR! import gyp.input npm ERR! File "/Users/runner/work//src/app/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 19, in 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 (/Users/runner/work//src/app/node_modules/node-gyp/lib/configure.js:325:16) npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:513:28) npm ERR! gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:293:12) npm ERR! gyp ERR! System Darwin 23.4.0 npm ERR! gyp ERR! command "/Users/runner/hostedtoolcache/node/16.20.2/arm64/bin/node" "/Users/runner/work//src/app/node_modules/.bin/node-gyp" "rebuild" npm ERR! gyp ERR! cwd /Users/runner/work//src/app/node_modules/leveldown npm ERR! gyp ERR! node -v v16.20.2 npm ERR! gyp ERR! node-gyp -v v9.4.0 npm ERR! gyp ERR! not ok

Platforms affected

Runner images affected

Image version and build link

runner image version: 2.314.1

Is it regression?

2.314.1

Expected behavior

npm install should execute without errors.

Actual behavior

I receive below error when I run npm install.

npm WARN deprecated formidable@1.2.6: Please upgrade to latest, formidable@v2 or formidable@v3! Check these notes: https://bit.ly/2ZEqIau npm ERR! code 1 npm ERR! path /Users/runner/work//src/app/node_modules/leveldown npm ERR! command failed npm ERR! command sh -c -- node-gyp-build 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@16.20.2 | darwin | arm64 npm ERR! gyp info find Python using Python version 3.12.2 found at "/opt/homebrew/opt/python@3.12/bin/python3.12" npm ERR! gyp http GET https://nodejs.org/download/release/v16.20.2/node-v16.20.2-headers.tar.gz npm ERR! gyp http 200 https://nodejs.org/download/release/v16.20.2/node-v16.20.2-headers.tar.gz npm ERR! gyp http GET https://nodejs.org/download/release/v16.20.2/SHASUMS256.txt npm ERR! gyp http 200 https://nodejs.org/download/release/v16.20.2/SHASUMS256.txt npm ERR! gyp info spawn /opt/homebrew/opt/python@3.12/bin/python3.12 npm ERR! gyp info spawn args [ npm ERR! gyp info spawn args '/Users/runner/work//src/app/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 '/Users/runner/work/src/app/node_modules/leveldown/build/config.gypi', npm ERR! gyp info spawn args '-I', npm ERR! gyp info spawn args '/Users/runner/work//src/app/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/16.20.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/16.20.2', npm ERR! gyp info spawn args '-Dnode_gyp_dir=/Users/runner/work//src/app/node_modules/node-gyp', npm ERR! gyp info spawn args '-Dnode_lib_file=/Users/runner/Library/Caches/node-gyp/16.20.2/<(target_arch)/node.lib', npm ERR! gyp info spawn args '-Dmodule_root_dir=/Users/runner/work//src/app/node_modules/leveldown', 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 "/Users/runner/work//src/app/node_modules/node-gyp/gyp/gyp_main.py", line 42, in npm ERR! import gyp # noqa: E402 npm ERR! ^^^^^^^^^^ npm ERR! File "/Users/runner/work//src/app/node_modules/node-gyp/gyp/pylib/gyp/init.py", line 9, in npm ERR! import gyp.input npm ERR! File "/Users/runner/work//src/app/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 19, in 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 (/Users/runner/work//src/app/node_modules/node-gyp/lib/configure.js:325:16) npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:513:28) npm ERR! gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:293:12) npm ERR! gyp ERR! System Darwin 23.4.0 npm ERR! gyp ERR! command "/Users/runner/hostedtoolcache/node/16.20.2/arm64/bin/node" "/Users/runner/work//src/app/node_modules/.bin/node-gyp" "rebuild" npm ERR! gyp ERR! cwd /Users/runner/work//src/app/node_modules/leveldown npm ERR! gyp ERR! node -v v16.20.2 npm ERR! gyp ERR! node-gyp -v v9.4.0 npm ERR! gyp ERR! not ok

Repro steps

runs-on: macos-latest run: npm install

shamil-mubarakshin commented 5 months ago

Hello @SandeshKR, I couldn't reproduce the issue. Checking provided logs, distutils was removed from python 3.12. It is also advisable not to use system python and use setup-python task instead for env configuration. Another observation would be that macos-latest is pointing to macos-12 and will be gradually migrated to macos-14