Skip to content

Invalid syntax error installing node-gyp 11.4.2 on python 3.6.8 #3218

Open

Description

@davidmejh

Please see log output below (repo path replaced with '...') . Is this using invalid syntax for Python 3.6.8? Note I am not able to control what version of Python is running in the build environment.

npm error gyp info using node-gyp@11.4.2
npm error gyp info using node@20.19.5 | linux | x64
npm error gyp info find Python using Python version 3.6.8 found at "/bin/python3"
npm error gyp http GET https://nodejs.org/download/release/v20.19.5/node-v20.19.5-headers.tar.gz
npm error gyp http 200 https://nodejs.org/download/release/v20.19.5/node-v20.19.5-headers.tar.gz
npm error gyp http GET https://nodejs.org/download/release/v20.19.5/SHASUMS256.txt
npm error gyp http 200 https://nodejs.org/download/release/v20.19.5/SHASUMS256.txt
npm error gyp info spawn /bin/python3
npm error gyp info spawn args [
npm error gyp info spawn args '/actions-runner/_work/.../node_modules/node-gyp/gyp/gyp_main.py',
npm error gyp info spawn args 'binding.gyp',
npm error gyp info spawn args '-f',
npm error gyp info spawn args 'make',
npm error gyp info spawn args '-I',
npm error gyp info spawn args '/actions-runner/_work/.../node_modules/re2/build/config.gypi',
npm error gyp info spawn args '-I',
npm error gyp info spawn args '/actions-runner/_work/.../node_modules/node-gyp/addon.gypi',
npm error gyp info spawn args '-I',
npm error gyp info spawn args '/root/.cache/node-gyp/20.19.5/include/node/common.gypi',
npm error gyp info spawn args '-Dlibrary=shared_library',
npm error gyp info spawn args '-Dvisibility=default',
npm error gyp info spawn args '-Dnode_root_dir=/root/.cache/node-gyp/20.19.5',
npm error gyp info spawn args '-Dnode_gyp_dir=/actions-runner/_work/.../node_modules/node-gyp',
npm error gyp info spawn args '-Dnode_lib_file=/root/.cache/node-gyp/20.19.5/<(target_arch)/node.lib',
npm error gyp info spawn args '-Dmodule_root_dir=/actions-runner/_work/.../node_modules/re2',
npm error gyp info spawn args '-Dnode_engine=v8',
npm error gyp info spawn args '--depth=.',
npm error gyp info spawn args '--no-parallel',
npm error gyp info spawn args '--generator-output',
npm error gyp info spawn args 'build',
npm error gyp info spawn args '-Goutput_dir=.'
npm error gyp info spawn args ]
npm error Traceback (most recent call last):
npm error   File "/actions-runner/_work/.../node_modules/node-gyp/gyp/gyp_main.py", line 42, in <module>
npm error     import gyp  # noqa: E402
npm error   File "/actions-runner/_work/.../node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 211
npm error     if flags := os.environ.get(env_name) or []:
npm error               ^
npm error SyntaxError: invalid syntax
npm error gyp ERR! configure error 
npm error gyp ERR! stack Error: `gyp` failed with exit code: 1
npm error gyp ERR! stack at ChildProcess.<anonymous> (/actions-runner/_work/.../node_modules/node-gyp/lib/configure.js:317:18)
npm error gyp ERR! stack at ChildProcess.emit (node:events:524:28)
npm error gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:293:12)
npm error gyp ERR! System Linux 4.18.0-553.75.1.el8_10.x86_64

Activity

  1. cclauss commented on Oct 1, 2025

    @cclauss
    Contributor

    Sorry but the world moves forward. Python 3.9 will go end-of-life next week so Python 3.6 is far behind in the rearview mirror. If is impossible to upgrade your build platform then it is known to be insecure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions