Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

Can't build docker image in macOS #1608

@krysal

Description

@krysal

Description

Python cannot be found and Node-gyp should be able to find and use Python.

The solution is suggested in the base image's Best Practices.

Reproduction

  1. Run:
docker build . --build-arg RELEASE=v0-test -t openverse-frontend:latest
  1. See the error:
Error message: installing deasync requires Python
#9 26.08 .../deasync@0.1.24/node_modules/deasync install$ node ./build.js
#9 26.20 .../deasync@0.1.24/node_modules/deasync install: gyp info it worked if it ends with ok
#9 26.20 .../deasync@0.1.24/node_modules/deasync install: gyp info using node-gyp@8.4.1
#9 26.20 .../deasync@0.1.24/node_modules/deasync install: gyp info using node@16.16.0 | linux | arm64
#9 26.25 .../deasync@0.1.24/node_modules/deasync install: gyp ERR! find Python 
#9 26.25 .../deasync@0.1.24/node_modules/deasync install: gyp ERR! find Python Python is not set from command line or npm configuration
#9 26.25 .../deasync@0.1.24/node_modules/deasync install: gyp ERR! find Python Python is not set from environment variable PYTHON
#9 26.25 .../deasync@0.1.24/node_modules/deasync install: gyp ERR! find Python checking if "python3" can be used
#9 26.25 .../deasync@0.1.24/node_modules/deasync install: gyp ERR! find Python - "python3" is not in PATH or produced an error
#9 26.25 .../deasync@0.1.24/node_modules/deasync install: gyp ERR! find Python checking if "python" can be used
#9 26.25 .../deasync@0.1.24/node_modules/deasync install: gyp ERR! find Python - "python" is not in PATH or produced an error
#9 26.25 .../deasync@0.1.24/node_modules/deasync install: gyp ERR! find Python 
#9 26.25 .../deasync@0.1.24/node_modules/deasync install: gyp ERR! find Python **********************************************************
#9 26.25 .../deasync@0.1.24/node_modules/deasync install: gyp ERR! find Python You need to install the latest version of Python.
#9 26.25 .../deasync@0.1.24/node_modules/deasync install: gyp ERR! find Python Node-gyp should be able to find and use Python. If not,
#9 26.25 .../deasync@0.1.24/node_modules/deasync install: gyp ERR! find Python you can try one of the following options:
#9 26.25 .../deasync@0.1.24/node_modules/deasync install: gyp ERR! find Python - Use the switch --python="/path/to/pythonexecutable"
#9 26.25 .../deasync@0.1.24/node_modules/deasync install: gyp ERR! find Python   (accepted by both node-gyp and npm)
#9 26.25 .../deasync@0.1.24/node_modules/deasync install: gyp ERR! find Python - Set the environment variable PYTHON
#9 26.25 .../deasync@0.1.24/node_modules/deasync install: gyp ERR! find Python - Set the npm configuration variable python:
#9 26.25 .../deasync@0.1.24/node_modules/deasync install: gyp ERR! find Python   npm config set python "/path/to/pythonexecutable"
#9 26.25 .../deasync@0.1.24/node_modules/deasync install: gyp ERR! find Python For more information consult the documentation at:
#9 26.25 .../deasync@0.1.24/node_modules/deasync install: gyp ERR! find Python https://github.com/nodejs/node-gyp#installation
#9 26.25 .../deasync@0.1.24/node_modules/deasync install: gyp ERR! find Python **********************************************************
#9 26.25 .../deasync@0.1.24/node_modules/deasync install: gyp ERR! find Python 
#9 26.25 .../deasync@0.1.24/node_modules/deasync install: gyp ERR! configure error 
#9 26.25 .../deasync@0.1.24/node_modules/deasync install: gyp ERR! stack Error: Could not find any Python installation to use
#9 26.25 .../deasync@0.1.24/node_modules/deasync install: gyp ERR! stack     at PythonFinder.fail (/usr/local/lib/node_modules/pnpm/dist/node_modules/node-gyp/lib/find-python.js:330:47)
#9 26.25 .../deasync@0.1.24/node_modules/deasync install: gyp ERR! stack     at PythonFinder.runChecks (/usr/local/lib/node_modules/pnpm/dist/node_modules/node-gyp/lib/find-python.js:159:21)
#9 26.25 .../deasync@0.1.24/node_modules/deasync install: gyp ERR! stack     at PythonFinder.<anonymous> (/usr/local/lib/node_modules/pnpm/dist/node_modules/node-gyp/lib/find-python.js:202:16)
#9 26.25 .../deasync@0.1.24/node_modules/deasync install: gyp ERR! stack     at PythonFinder.execFileCallback (/usr/local/lib/node_modules/pnpm/dist/node_modules/node-gyp/lib/find-python.js:294:16)
#9 26.25 .../deasync@0.1.24/node_modules/deasync install: gyp ERR! stack     at exithandler (node:child_process:406:5)
#9 26.25 .../deasync@0.1.24/node_modules/deasync install: gyp ERR! stack     at ChildProcess.errorhandler (node:child_process:418:5)
#9 26.25 .../deasync@0.1.24/node_modules/deasync install: gyp ERR! stack     at ChildProcess.emit (node:events:527:28)
#9 26.25 .../deasync@0.1.24/node_modules/deasync install: gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:289:12)
#9 26.25 .../deasync@0.1.24/node_modules/deasync install: gyp ERR! stack     at onErrorNT (node:internal/child_process:478:16)
#9 26.25 .../deasync@0.1.24/node_modules/deasync install: gyp ERR! stack     at processTicksAndRejections (node:internal/process/task_queues:83:21)
#9 26.25 .../deasync@0.1.24/node_modules/deasync install: gyp ERR! System Linux 5.10.104-linuxkit
#9 26.25 .../deasync@0.1.24/node_modules/deasync install: gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/pnpm/dist/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
#9 26.25 .../deasync@0.1.24/node_modules/deasync install: gyp ERR! cwd /home/node/app/node_modules/.pnpm/deasync@0.1.24/node_modules/deasync
#9 26.25 .../deasync@0.1.24/node_modules/deasync install: gyp ERR! node -v v16.16.0
#9 26.25 .../deasync@0.1.24/node_modules/deasync install: gyp ERR! node-gyp -v v8.4.1
#9 26.25 .../deasync@0.1.24/node_modules/deasync install: gyp ERR! not ok 
#9 26.26 .../deasync@0.1.24/node_modules/deasync install: Build failed
#9 26.26 .../deasync@0.1.24/node_modules/deasync install: Failed
#9 26.26  ELIFECYCLE  Command failed with exit code 1.
------
executor failed running [/bin/sh -c pnpm fetch]: exit code: 1

Environment

  • Device: MacBook Pro (M1, 2020)
  • OS: macOS

Additional context

First detected in #1385 and then in #1569.

Resolution

  • 🙋 I would be interested in resolving this bug.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions