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

[BUG] Can not build binary packages on Debian Stretch #40

Closed
ronilan opened this issue Nov 1, 2021 · 4 comments
Closed

[BUG] Can not build binary packages on Debian Stretch #40

ronilan opened this issue Nov 1, 2021 · 4 comments

Comments

@ronilan
Copy link

ronilan commented Nov 1, 2021

What / Why

Can not build binary packages on Debian 9 (Stretch) using NPM and Node 16..

Debian 9 (Stretch) comes with Python 3.5.
It is in LTS mode until the end of June 2022.

Node-Gyp version 8 requires Python 3.6 and above.
That was introduced when support for Python 2 was dropped.

With feat: update to node-gyp@8 support for Debian 9 was inadvertently dropped.

When

When using nodejs official docker image any npm install that requires building a binary package will fail.

Problem extends to any out-of-the box Debian 9 (Stretch).

Where

Node 16 and Debian 9 (Stretch)

How

Current Behavior

node-gyp can not find suitable python.

Specifically:

gyp ERR! find Python - version is 3.5.3 - should be >=3.6.0
gyp ERR! find Python - THIS VERSION OF PYTHON IS NOT SUPPORTED

Log (from GH Actions run specified below):

gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | linux | x64
gyp ERR! find Python 
gyp ERR! find Python Python is not set from command line or npm configuration
gyp ERR! find Python Python is not set from environment variable PYTHON
gyp ERR! find Python checking if "python3" can be used
gyp ERR! find Python - executable path is "/usr/bin/python3"
gyp ERR! find Python - version is "3.5.3"
gyp ERR! find Python - version is 3.5.3 - should be >=3.6.0
gyp ERR! find Python - THIS VERSION OF PYTHON IS NOT SUPPORTED
gyp ERR! find Python checking if "python" can be used
gyp ERR! find Python - executable path is "/usr/bin/python"
gyp ERR! find Python - version is "2.7.13"
Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/__w/appoptics-bindings-node-dev/appoptics-bindings-node-dev/dist/napi-v7/apm_bindings.node --module_name=apm_bindings --module_path=/__w/appoptics-bindings-node-dev/appoptics-bindings-node-dev/dist/napi-v7 --napi_version=8 --node_abi_napi=napi --napi_build_version=7 --node_napi_label=napi-v7' (1)
gyp ERR! find Python - version is 2.7.13 - should be >=3.6.0
gyp ERR! find Python - THIS VERSION OF PYTHON IS NOT SUPPORTED
gyp ERR! find Python 
gyp ERR! find Python **********************************************************
gyp ERR! find Python You need to install the latest version of Python.
gyp ERR! find Python Node-gyp should be able to find and use Python. If not,
gyp ERR! find Python you can try one of the following options:
gyp ERR! find Python - Use the switch --python="/path/to/pythonexecutable"
gyp ERR! find Python   (accepted by both node-gyp and npm)
gyp ERR! find Python - Set the environment variable PYTHON
gyp ERR! find Python - Set the npm configuration variable python:
gyp ERR! find Python   npm config set python "/path/to/pythonexecutable"
gyp ERR! find Python For more information consult the documentation at:
gyp ERR! find Python https://github.com/nodejs/node-gyp#installation
gyp ERR! find Python **********************************************************
gyp ERR! find Python 
gyp ERR! configure error 
gyp ERR! stack Error: Could not find any Python installation to use

Steps to Reproduce

Pull image:
docker run -it -w /usr/src/work node:16-stretch bash

npm install @appoptics/apm-bindings --build-from-source

npm install canvas --build-from-source

etc.

Expected Behavior

As was before update to node-gyp@8 - node-gyp can find suitable python.

gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | linux | x64
gyp info ok 
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | linux | x64
gyp info find Python using Python version 3.5.3 found at "/usr/bin/python3"
gyp http GET https://nodejs.org/download/release/v16.9.1/node-v16.9.1-headers.tar.gz
gyp http 200 https://nodejs.org/download/release/v16.9.1/node-v16.9.1-headers.tar.gz
gyp http GET https://nodejs.org/download/release/v16.9.1/SHASUMS256.txt
gyp http 200 https://nodejs.org/download/release/v16.9.1/SHASUMS256.txt

Who

  • n/a

References

@cclauss
Copy link

cclauss commented Nov 2, 2021

Node-Gyp version 8 requires Python 3.6 and above.
That was introduced when support for Python 2 was dropped.

That was introduced when support for Python 3.5 was dropped.

I would recommend the use of https://github.com/pyenv or https://github.com/deadsnakes to install a supported version of Python.

@wraithgar
Copy link
Member

Yes you are going to need to update to a supported version of python. This was not inadvertent, it was discussed when we were planning the upgrade to node-gyp@8

@ronilan
Copy link
Author

ronilan commented Nov 2, 2021

Yes you are going to need to update to a supported version of python.

Thanks for pointing out the discussion in summer. Missed that. I think though that @DeeDeeG had (has) a point. There are a lot of users downstream from NPM and this update "breaks" the official image turning it from a "builder image" to one that can not build binaries.

Anyway.. your call. Onwards.

@wraithgar
Copy link
Member

nodejs/docker-node#1601

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

Successfully merging a pull request may close this issue.

3 participants