question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Python syntax error in dynamically generated 'build/gyp-mac-tool' file when python3 on the PATH is < 3.6

See original GitHub issue
  • Node Version: Latest 10, 12, 14 and 15 (10.24.0, 12.21.0, 14.16.0, 15.12.0)
  • Platform: macOS “Catalina” 10.15.7
  • Compiler: Apple clang version 12.0.0 (clang-1200.0.32.29)
  • Module: git-utils, leveldown, superstring
Verbose output (from node-gyp rebuild --verbose):
% /Users/[user]/node-gyp/bin/node-gyp.js rebuild --verbose
gyp info it worked if it ends with ok
gyp verb cli [
gyp verb cli   '/Users/[user]/n-prefix/bin/node',
gyp verb cli   '/Users/[user]/node-gyp/bin/node-gyp.js',
gyp verb cli   'rebuild',
gyp verb cli   '--verbose'
gyp verb cli ]
gyp info using node-gyp@7.1.2
gyp info using node@15.12.0 | darwin | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb find Python Python is not set from command line or npm configuration
gyp verb find Python Python is not set from environment variable PYTHON
gyp verb find Python checking if "python3" can be used
gyp verb find Python - executing "python3" to get executable path
gyp verb find Python - executable path is "/Library/Frameworks/Python.framework/Versions/3.10/bin/python3"
gyp verb find Python - executing "/Library/Frameworks/Python.framework/Versions/3.10/bin/python3" to get version
gyp verb find Python - version is "3.10.0"
gyp info find Python using Python version 3.10.0 found at "/Library/Frameworks/Python.framework/Versions/3.10/bin/python3"
gyp verb get node dir no --target version specified, falling back to host node version: 15.12.0
gyp verb command install [ '15.12.0' ]
gyp verb install input version string "15.12.0"
gyp verb install installing version: 15.12.0
gyp verb install --ensure was passed, so won't reinstall if already installed
gyp verb install version is already installed, need to check "installVersion"
gyp verb got "installVersion" 9
gyp verb needs "installVersion" 9
gyp verb install version is good
gyp verb get node dir target node version installed: 15.12.0
gyp verb build dir attempting to create "build" dir: /Users/[user]/github/node_modules/superstring/build
gyp verb build dir "build" dir needed to be created? /Users/[user]/github/node_modules/superstring/build
gyp verb build/config.gypi creating config file
gyp verb build/config.gypi writing out config file: /Users/[user]/github/node_modules/superstring/build/config.gypi
gyp verb config.gypi checking for gypi file: /Users/[user]/github/node_modules/superstring/config.gypi
gyp verb common.gypi checking for gypi file: /Users/[user]/github/node_modules/superstring/common.gypi
gyp verb gyp gyp format was not specified; forcing "make"
gyp info spawn /Library/Frameworks/Python.framework/Versions/3.10/bin/python3
gyp info spawn args [
gyp info spawn args   '/Users/[user]/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/[user]/github/node_modules/superstring/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/[user]/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/[user]/Library/Caches/node-gyp/15.12.0/include/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/Users/[user]/Library/Caches/node-gyp/15.12.0',
gyp info spawn args   '-Dnode_gyp_dir=/Users/[user]/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/Users/[user]/Library/Caches/node-gyp/15.12.0/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/Users/[user]/github/node_modules/superstring',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.'
gyp info spawn args ]
gyp verb command build []
gyp verb build type Release
gyp verb architecture x64
gyp verb node dev dir /Users/[user]/Library/Caches/node-gyp/15.12.0
gyp verb `which` succeeded for `make` /usr/bin/make
gyp info spawn make
gyp info spawn args [ 'V=1', 'BUILDTYPE=Release', '-C', 'build' ]
  c++ -o Release/obj.target/superstring_core/src/core/encoding-conversion.o ../src/core/encoding-conversion.cc '-DNODE_GYP_MODULE_NAME=superstring_core' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DPCRE2_CODE_UNIT_WIDTH=16' -I/Users/[user]/Library/Caches/node-gyp/15.12.0/include/node -I/Users/[user]/Library/Caches/node-gyp/15.12.0/src -I/Users/[user]/Library/Caches/node-gyp/15.12.0/deps/openssl/config -I/Users/[user]/Library/Caches/node-gyp/15.12.0/deps/openssl/openssl/include -I/Users/[user]/Library/Caches/node-gyp/15.12.0/deps/uv/include -I/Users/[user]/Library/Caches/node-gyp/15.12.0/deps/zlib -I/Users/[user]/Library/Caches/node-gyp/15.12.0/deps/v8/include -I../vendor/libcxx -I../vendor/pcre/include  -O3 -gdwarf-2 -mmacosx-version-min=10.13 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -std=gnu++1y -stdlib=libc++ -fno-rtti -fno-exceptions -fno-strict-aliasing -MMD -MF ./Release/.deps/Release/obj.target/superstring_core/src/core/encoding-conversion.o.d.raw   -c
  c++ -o Release/obj.target/superstring_core/src/core/marker-index.o ../src/core/marker-index.cc '-DNODE_GYP_MODULE_NAME=superstring_core' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DPCRE2_CODE_UNIT_WIDTH=16' -I/Users/[user]/Library/Caches/node-gyp/15.12.0/include/node -I/Users/[user]/Library/Caches/node-gyp/15.12.0/src -I/Users/[user]/Library/Caches/node-gyp/15.12.0/deps/openssl/config -I/Users/[user]/Library/Caches/node-gyp/15.12.0/deps/openssl/openssl/include -I/Users/[user]/Library/Caches/node-gyp/15.12.0/deps/uv/include -I/Users/[user]/Library/Caches/node-gyp/15.12.0/deps/zlib -I/Users/[user]/Library/Caches/node-gyp/15.12.0/deps/v8/include -I../vendor/libcxx -I../vendor/pcre/include  -O3 -gdwarf-2 -mmacosx-version-min=10.13 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -std=gnu++1y -stdlib=libc++ -fno-rtti -fno-exceptions -fno-strict-aliasing -MMD -MF ./Release/.deps/Release/obj.target/superstring_core/src/core/marker-index.o.d.raw   -c
  c++ -o Release/obj.target/superstring_core/src/core/patch.o ../src/core/patch.cc '-DNODE_GYP_MODULE_NAME=superstring_core' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DPCRE2_CODE_UNIT_WIDTH=16' -I/Users/[user]/Library/Caches/node-gyp/15.12.0/include/node -I/Users/[user]/Library/Caches/node-gyp/15.12.0/src -I/Users/[user]/Library/Caches/node-gyp/15.12.0/deps/openssl/config -I/Users/[user]/Library/Caches/node-gyp/15.12.0/deps/openssl/openssl/include -I/Users/[user]/Library/Caches/node-gyp/15.12.0/deps/uv/include -I/Users/[user]/Library/Caches/node-gyp/15.12.0/deps/zlib -I/Users/[user]/Library/Caches/node-gyp/15.12.0/deps/v8/include -I../vendor/libcxx -I../vendor/pcre/include  -O3 -gdwarf-2 -mmacosx-version-min=10.13 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -std=gnu++1y -stdlib=libc++ -fno-rtti -fno-exceptions -fno-strict-aliasing -MMD -MF ./Release/.deps/Release/obj.target/superstring_core/src/core/patch.o.d.raw   -c
  c++ -o Release/obj.target/superstring_core/src/core/point.o ../src/core/point.cc '-DNODE_GYP_MODULE_NAME=superstring_core' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DPCRE2_CODE_UNIT_WIDTH=16' -I/Users/[user]/Library/Caches/node-gyp/15.12.0/include/node -I/Users/[user]/Library/Caches/node-gyp/15.12.0/src -I/Users/[user]/Library/Caches/node-gyp/15.12.0/deps/openssl/config -I/Users/[user]/Library/Caches/node-gyp/15.12.0/deps/openssl/openssl/include -I/Users/[user]/Library/Caches/node-gyp/15.12.0/deps/uv/include -I/Users/[user]/Library/Caches/node-gyp/15.12.0/deps/zlib -I/Users/[user]/Library/Caches/node-gyp/15.12.0/deps/v8/include -I../vendor/libcxx -I../vendor/pcre/include  -O3 -gdwarf-2 -mmacosx-version-min=10.13 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -std=gnu++1y -stdlib=libc++ -fno-rtti -fno-exceptions -fno-strict-aliasing -MMD -MF ./Release/.deps/Release/obj.target/superstring_core/src/core/point.o.d.raw   -c
  c++ -o Release/obj.target/superstring_core/src/core/range.o ../src/core/range.cc '-DNODE_GYP_MODULE_NAME=superstring_core' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DPCRE2_CODE_UNIT_WIDTH=16' -I/Users/[user]/Library/Caches/node-gyp/15.12.0/include/node -I/Users/[user]/Library/Caches/node-gyp/15.12.0/src -I/Users/[user]/Library/Caches/node-gyp/15.12.0/deps/openssl/config -I/Users/[user]/Library/Caches/node-gyp/15.12.0/deps/openssl/openssl/include -I/Users/[user]/Library/Caches/node-gyp/15.12.0/deps/uv/include -I/Users/[user]/Library/Caches/node-gyp/15.12.0/deps/zlib -I/Users/[user]/Library/Caches/node-gyp/15.12.0/deps/v8/include -I../vendor/libcxx -I../vendor/pcre/include  -O3 -gdwarf-2 -mmacosx-version-min=10.13 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -std=gnu++1y -stdlib=libc++ -fno-rtti -fno-exceptions -fno-strict-aliasing -MMD -MF ./Release/.deps/Release/obj.target/superstring_core/src/core/range.o.d.raw   -c
  c++ -o Release/obj.target/superstring_core/src/core/regex.o ../src/core/regex.cc '-DNODE_GYP_MODULE_NAME=superstring_core' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DPCRE2_CODE_UNIT_WIDTH=16' -I/Users/[user]/Library/Caches/node-gyp/15.12.0/include/node -I/Users/[user]/Library/Caches/node-gyp/15.12.0/src -I/Users/[user]/Library/Caches/node-gyp/15.12.0/deps/openssl/config -I/Users/[user]/Library/Caches/node-gyp/15.12.0/deps/openssl/openssl/include -I/Users/[user]/Library/Caches/node-gyp/15.12.0/deps/uv/include -I/Users/[user]/Library/Caches/node-gyp/15.12.0/deps/zlib -I/Users/[user]/Library/Caches/node-gyp/15.12.0/deps/v8/include -I../vendor/libcxx -I../vendor/pcre/include  -O3 -gdwarf-2 -mmacosx-version-min=10.13 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -std=gnu++1y -stdlib=libc++ -fno-rtti -fno-exceptions -fno-strict-aliasing -MMD -MF ./Release/.deps/Release/obj.target/superstring_core/src/core/regex.o.d.raw   -c
  c++ -o Release/obj.target/superstring_core/src/core/text.o ../src/core/text.cc '-DNODE_GYP_MODULE_NAME=superstring_core' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DPCRE2_CODE_UNIT_WIDTH=16' -I/Users/[user]/Library/Caches/node-gyp/15.12.0/include/node -I/Users/[user]/Library/Caches/node-gyp/15.12.0/src -I/Users/[user]/Library/Caches/node-gyp/15.12.0/deps/openssl/config -I/Users/[user]/Library/Caches/node-gyp/15.12.0/deps/openssl/openssl/include -I/Users/[user]/Library/Caches/node-gyp/15.12.0/deps/uv/include -I/Users/[user]/Library/Caches/node-gyp/15.12.0/deps/zlib -I/Users/[user]/Library/Caches/node-gyp/15.12.0/deps/v8/include -I../vendor/libcxx -I../vendor/pcre/include  -O3 -gdwarf-2 -mmacosx-version-min=10.13 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -std=gnu++1y -stdlib=libc++ -fno-rtti -fno-exceptions -fno-strict-aliasing -MMD -MF ./Release/.deps/Release/obj.target/superstring_core/src/core/text.o.d.raw   -c
  c++ -o Release/obj.target/superstring_core/src/core/text-buffer.o ../src/core/text-buffer.cc '-DNODE_GYP_MODULE_NAME=superstring_core' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DPCRE2_CODE_UNIT_WIDTH=16' -I/Users/[user]/Library/Caches/node-gyp/15.12.0/include/node -I/Users/[user]/Library/Caches/node-gyp/15.12.0/src -I/Users/[user]/Library/Caches/node-gyp/15.12.0/deps/openssl/config -I/Users/[user]/Library/Caches/node-gyp/15.12.0/deps/openssl/openssl/include -I/Users/[user]/Library/Caches/node-gyp/15.12.0/deps/uv/include -I/Users/[user]/Library/Caches/node-gyp/15.12.0/deps/zlib -I/Users/[user]/Library/Caches/node-gyp/15.12.0/deps/v8/include -I../vendor/libcxx -I../vendor/pcre/include  -O3 -gdwarf-2 -mmacosx-version-min=10.13 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -std=gnu++1y -stdlib=libc++ -fno-rtti -fno-exceptions -fno-strict-aliasing -MMD -MF ./Release/.deps/Release/obj.target/superstring_core/src/core/text-buffer.o.d.raw   -c
  c++ -o Release/obj.target/superstring_core/src/core/text-slice.o ../src/core/text-slice.cc '-DNODE_GYP_MODULE_NAME=superstring_core' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DPCRE2_CODE_UNIT_WIDTH=16' -I/Users/[user]/Library/Caches/node-gyp/15.12.0/include/node -I/Users/[user]/Library/Caches/node-gyp/15.12.0/src -I/Users/[user]/Library/Caches/node-gyp/15.12.0/deps/openssl/config -I/Users/[user]/Library/Caches/node-gyp/15.12.0/deps/openssl/openssl/include -I/Users/[user]/Library/Caches/node-gyp/15.12.0/deps/uv/include -I/Users/[user]/Library/Caches/node-gyp/15.12.0/deps/zlib -I/Users/[user]/Library/Caches/node-gyp/15.12.0/deps/v8/include -I../vendor/libcxx -I../vendor/pcre/include  -O3 -gdwarf-2 -mmacosx-version-min=10.13 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -std=gnu++1y -stdlib=libc++ -fno-rtti -fno-exceptions -fno-strict-aliasing -MMD -MF ./Release/.deps/Release/obj.target/superstring_core/src/core/text-slice.o.d.raw   -c
  c++ -o Release/obj.target/superstring_core/src/core/text-diff.o ../src/core/text-diff.cc '-DNODE_GYP_MODULE_NAME=superstring_core' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DPCRE2_CODE_UNIT_WIDTH=16' -I/Users/[user]/Library/Caches/node-gyp/15.12.0/include/node -I/Users/[user]/Library/Caches/node-gyp/15.12.0/src -I/Users/[user]/Library/Caches/node-gyp/15.12.0/deps/openssl/config -I/Users/[user]/Library/Caches/node-gyp/15.12.0/deps/openssl/openssl/include -I/Users/[user]/Library/Caches/node-gyp/15.12.0/deps/uv/include -I/Users/[user]/Library/Caches/node-gyp/15.12.0/deps/zlib -I/Users/[user]/Library/Caches/node-gyp/15.12.0/deps/v8/include -I../vendor/libcxx -I../vendor/pcre/include  -O3 -gdwarf-2 -mmacosx-version-min=10.13 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -std=gnu++1y -stdlib=libc++ -fno-rtti -fno-exceptions -fno-strict-aliasing -MMD -MF ./Release/.deps/Release/obj.target/superstring_core/src/core/text-diff.o.d.raw   -c
  c++ -o Release/obj.target/superstring_core/src/core/libmba-diff.o ../src/core/libmba-diff.cc '-DNODE_GYP_MODULE_NAME=superstring_core' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DPCRE2_CODE_UNIT_WIDTH=16' -I/Users/[user]/Library/Caches/node-gyp/15.12.0/include/node -I/Users/[user]/Library/Caches/node-gyp/15.12.0/src -I/Users/[user]/Library/Caches/node-gyp/15.12.0/deps/openssl/config -I/Users/[user]/Library/Caches/node-gyp/15.12.0/deps/openssl/openssl/include -I/Users/[user]/Library/Caches/node-gyp/15.12.0/deps/uv/include -I/Users/[user]/Library/Caches/node-gyp/15.12.0/deps/zlib -I/Users/[user]/Library/Caches/node-gyp/15.12.0/deps/v8/include -I../vendor/libcxx -I../vendor/pcre/include  -O3 -gdwarf-2 -mmacosx-version-min=10.13 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -std=gnu++1y -stdlib=libc++ -fno-rtti -fno-exceptions -fno-strict-aliasing -MMD -MF ./Release/.deps/Release/obj.target/superstring_core/src/core/libmba-diff.o.d.raw   -c
  rm -f Release/superstring_core.a && ./gyp-mac-tool filter-libtool libtool  -static -o Release/superstring_core.a Release/obj.target/superstring_core/src/core/encoding-conversion.o Release/obj.target/superstring_core/src/core/marker-index.o Release/obj.target/superstring_core/src/core/patch.o Release/obj.target/superstring_core/src/core/point.o Release/obj.target/superstring_core/src/core/range.o Release/obj.target/superstring_core/src/core/regex.o Release/obj.target/superstring_core/src/core/text.o Release/obj.target/superstring_core/src/core/text-buffer.o Release/obj.target/superstring_core/src/core/text-slice.o Release/obj.target/superstring_core/src/core/text-diff.o Release/obj.target/superstring_core/src/core/libmba-diff.o
  File "./gyp-mac-tool", line 252
    fp.write(f"{package_type}{signature_code}")
                                             ^
SyntaxError: invalid syntax
make: *** [Release/superstring_core.a] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/[user]/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (node:events:369:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
gyp ERR! System Darwin 19.6.0
gyp ERR! command "/Users/[user]/n-prefix/bin/node" "/Users/[user]/node-gyp/bin/node-gyp.js" "rebuild" "--verbose"
gyp ERR! cwd /Users/[user]/github/node_modules/superstring
gyp ERR! node -v v15.12.0
gyp ERR! node-gyp -v v7.1.2
gyp ERR! not ok 

More info:

Only node-gyp from git master is affected; The latest release to the npm package registry 7.1.2 is unaffected.

The error looks like this:

  File "./gyp-mac-tool", line 252
    fp.write(f"{package_type}{signature_code}")
                                             ^
SyntaxError: invalid syntax
make: *** [Release/superstring_core.a] Error 1

When this error occurs, it’s always the same syntax error at line 252 of gyp-mac-tool. Some (most?) packages appear to be unaffected, but I’ve found a few packages which are affected: git-utils, leveldown, and superstring.

(Maybe this has to do with the gyp-next v0.7.0 or v0.8.0 upgrades?)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:14 (14 by maintainers)

github_iconTop GitHub Comments

2reactions
richardlaucommented, Mar 24, 2021

https://github.com/nodejs/node-gyp/blob/e81602ef55023cc8ffeebc5509a9a8649d60434d/gyp/pylib/gyp/mac_tool.py#L1 has a #!/usr/bin/env python header so maybe it’s not using the version of Python you’re expecting it to.

0reactions
DeeDeeGcommented, Oct 10, 2021

Now that the shebangs in gyp-next are python3 I updated the issue title.

This issue now affects anyone with python3 older than 3.6 first on their PATH… who were able to supply the path to Python >= 3.6 for use earlier in node-gyp’s run. Such as with the PYTHON env var, or the npm config item npm_config_python.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Invalid Syntax in Python: Common Reasons for SyntaxError
There are a few elements of a SyntaxError traceback that can help you determine where the invalid syntax is in your code: The...
Read more >
py -2 pointing to Python 3.x path and returning syntax error
Installed both Python 3.6 and 2.7 on my Win10 system, on trying to use the Python launcher for 2.7 I get the following...
Read more >
Syntax Error in Python 3.10 when running on Terminal
After access to the location of the py file, I tried to run it using: “Python .py” - but I got the following...
Read more >
Compiling the source code raises syntax errors #791 - GitHub
Pull the source code; Navigate to src and execute python3 -m compileall debugpy. More information. I've a python script that imports debugpy ( ......
Read more >
Syntax error when selecting rows - PsychoPy Discourse
I'm trying to do something similar to the OP using @lindeloev's “select rows dynamically” method in PsychoPy 1.84.2, except instead of randomizing within ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found