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

Can't build docker image in macOS #1608

Closed
1 task done
krysal opened this issue Aug 1, 2022 · 0 comments · Fixed by #1609
Closed
1 task done

Can't build docker image in macOS #1608

krysal opened this issue Aug 1, 2022 · 0 comments · Fixed by #1609
Assignees
Labels
🤖 aspect: dx Concerns developers' experience with the codebase 🛠 goal: fix Bug fix 🟨 priority: medium Not blocking but should be addressed soon

Comments

@krysal
Copy link
Member

krysal commented Aug 1, 2022

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 .../[email protected]/node_modules/deasync install$ node ./build.js
#9 26.20 .../[email protected]/node_modules/deasync install: gyp info it worked if it ends with ok
#9 26.20 .../[email protected]/node_modules/deasync install: gyp info using [email protected]
#9 26.20 .../[email protected]/node_modules/deasync install: gyp info using [email protected] | linux | arm64
#9 26.25 .../[email protected]/node_modules/deasync install: gyp ERR! find Python 
#9 26.25 .../[email protected]/node_modules/deasync install: gyp ERR! find Python Python is not set from command line or npm configuration
#9 26.25 .../[email protected]/node_modules/deasync install: gyp ERR! find Python Python is not set from environment variable PYTHON
#9 26.25 .../[email protected]/node_modules/deasync install: gyp ERR! find Python checking if "python3" can be used
#9 26.25 .../[email protected]/node_modules/deasync install: gyp ERR! find Python - "python3" is not in PATH or produced an error
#9 26.25 .../[email protected]/node_modules/deasync install: gyp ERR! find Python checking if "python" can be used
#9 26.25 .../[email protected]/node_modules/deasync install: gyp ERR! find Python - "python" is not in PATH or produced an error
#9 26.25 .../[email protected]/node_modules/deasync install: gyp ERR! find Python 
#9 26.25 .../[email protected]/node_modules/deasync install: gyp ERR! find Python **********************************************************
#9 26.25 .../[email protected]/node_modules/deasync install: gyp ERR! find Python You need to install the latest version of Python.
#9 26.25 .../[email protected]/node_modules/deasync install: gyp ERR! find Python Node-gyp should be able to find and use Python. If not,
#9 26.25 .../[email protected]/node_modules/deasync install: gyp ERR! find Python you can try one of the following options:
#9 26.25 .../[email protected]/node_modules/deasync install: gyp ERR! find Python - Use the switch --python="/path/to/pythonexecutable"
#9 26.25 .../[email protected]/node_modules/deasync install: gyp ERR! find Python   (accepted by both node-gyp and npm)
#9 26.25 .../[email protected]/node_modules/deasync install: gyp ERR! find Python - Set the environment variable PYTHON
#9 26.25 .../[email protected]/node_modules/deasync install: gyp ERR! find Python - Set the npm configuration variable python:
#9 26.25 .../[email protected]/node_modules/deasync install: gyp ERR! find Python   npm config set python "/path/to/pythonexecutable"
#9 26.25 .../[email protected]/node_modules/deasync install: gyp ERR! find Python For more information consult the documentation at:
#9 26.25 .../[email protected]/node_modules/deasync install: gyp ERR! find Python https://github.com/nodejs/node-gyp#installation
#9 26.25 .../[email protected]/node_modules/deasync install: gyp ERR! find Python **********************************************************
#9 26.25 .../[email protected]/node_modules/deasync install: gyp ERR! find Python 
#9 26.25 .../[email protected]/node_modules/deasync install: gyp ERR! configure error 
#9 26.25 .../[email protected]/node_modules/deasync install: gyp ERR! stack Error: Could not find any Python installation to use
#9 26.25 .../[email protected]/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 .../[email protected]/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 .../[email protected]/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 .../[email protected]/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 .../[email protected]/node_modules/deasync install: gyp ERR! stack     at exithandler (node:child_process:406:5)
#9 26.25 .../[email protected]/node_modules/deasync install: gyp ERR! stack     at ChildProcess.errorhandler (node:child_process:418:5)
#9 26.25 .../[email protected]/node_modules/deasync install: gyp ERR! stack     at ChildProcess.emit (node:events:527:28)
#9 26.25 .../[email protected]/node_modules/deasync install: gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:289:12)
#9 26.25 .../[email protected]/node_modules/deasync install: gyp ERR! stack     at onErrorNT (node:internal/child_process:478:16)
#9 26.25 .../[email protected]/node_modules/deasync install: gyp ERR! stack     at processTicksAndRejections (node:internal/process/task_queues:83:21)
#9 26.25 .../[email protected]/node_modules/deasync install: gyp ERR! System Linux 5.10.104-linuxkit
#9 26.25 .../[email protected]/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 .../[email protected]/node_modules/deasync install: gyp ERR! cwd /home/node/app/node_modules/.pnpm/[email protected]/node_modules/deasync
#9 26.25 .../[email protected]/node_modules/deasync install: gyp ERR! node -v v16.16.0
#9 26.25 .../[email protected]/node_modules/deasync install: gyp ERR! node-gyp -v v8.4.1
#9 26.25 .../[email protected]/node_modules/deasync install: gyp ERR! not ok 
#9 26.26 .../[email protected]/node_modules/deasync install: Build failed
#9 26.26 .../[email protected]/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.
@krysal krysal added 🚦 status: awaiting triage Has not been triaged & therefore, not ready for work 🛠 goal: fix Bug fix labels Aug 1, 2022
@krysal krysal self-assigned this Aug 1, 2022
@krysal krysal added 🟨 priority: medium Not blocking but should be addressed soon 🤖 aspect: dx Concerns developers' experience with the codebase and removed 🚦 status: awaiting triage Has not been triaged & therefore, not ready for work labels Aug 1, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🤖 aspect: dx Concerns developers' experience with the codebase 🛠 goal: fix Bug fix 🟨 priority: medium Not blocking but should be addressed soon
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant