Error when deploying a nextjs app
#10 22.85 npm ERR! code 1
#10 22.85 npm ERR! path /app/node_modules/usb
#10 22.85 npm ERR! command failed
#10 22.85 npm ERR! command sh -c node-gyp-build
#10 22.85 npm ERR! gyp info it worked if it ends with ok
#10 22.85 npm ERR! gyp info using [email protected]
#10 22.85 npm ERR! gyp info using [email protected] | linux | x64
#10 22.85 npm ERR! gyp ERR! find Python
#10 22.85 npm ERR! gyp ERR! find Python Python is not set from command line or npm configuration
#10 22.85 npm ERR! gyp ERR! find Python Python is not set from environment variable PYTHON
#10 22.85 npm ERR! gyp ERR! find Python checking if "python3" can be used
#10 22.85 npm ERR! gyp ERR! find Python - executable path is ""
#10 22.85 npm ERR! gyp ERR! find Python - "" could not be run
#10 22.85 npm ERR! gyp ERR! find Python checking if "python" can be used
#10 22.85 npm ERR! gyp ERR! find Python - executable path is ""
#10 22.85 npm ERR! gyp ERR! find Python - "" could not be run
#10 22.85 npm ERR! gyp ERR! find Python
#10 22.85 npm ERR! gyp ERR! find Python **
#10 22.85 npm ERR! gyp ERR! find Python You need to install the latest version of Python.
#10 22.85 npm ERR! gyp ERR! find Python Node-gyp should be able to find and use Python. If not,
#10 22.85 npm ERR! gyp ERR! find Python you can try one of the following options:
#10 22.85 npm ERR! gyp ERR! find Python - Use the switch --python="/path/to/pythonexecutable"
#10 22.85 npm ERR! gyp ERR! find Python (accepted by both node-gyp and npm)
#10 22.85 npm ERR! gyp ERR! find Python - Set the environment variable PYTHON
#10 22.85 npm ERR! gyp ERR! find Python - Set the npm configuration variable python:
#10 22.85 npm ERR! gyp ERR! find Python npm config set python "/path/to/pythonexecutable"
#10 22.85 npm ERR! gyp ERR! find Python For more information consult the documentation at:
#10 22.85 npm ERR! gyp ERR! find Python https://github.com/nodejs/node-gyp#installation
#10 22.85 npm ERR! gyp ERR! find Python **
#10 22.85 npm ERR! gyp ERR! find Python
#10 22.85 npm ERR! gyp ERR! configure error
#10 22.85 npm ERR! gyp ERR! stack Error: Could not find any Python installation to use
#10 22.85 npm ERR! gyp ERR! stack at PythonFinder.fail (/nix/store/kr6p8nmj3y4wmfm3q6f0j8yd2zb2lxaj-nodejs-18.20.2/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:306:11)
#10 22.85 npm ERR! gyp ERR! stack at PythonFinder.findPython (/nix/store/kr6p8nmj3y4wmfm3q6f0j8yd2zb2lxaj-nodejs-18.20.2/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:164:17)
#10 22.85 npm ERR! gyp ERR! stack at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
#10 22.85 npm ERR! gyp ERR! stack at async configure (/nix/store/kr6p8nmj3y4wmfm3q6f0j8yd2zb2lxaj-nodejs-18.20.2/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:23:18)
#10 22.85 npm ERR! gyp ERR! stack at async run (/nix/store/kr6p8nmj3y4wmfm3q6f0j8yd2zb2lxaj-nodejs-18.20.2/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js:81:18)
#10 22.85 npm ERR! gyp ERR! System Linux 6.1.0-25-cloud-amd64
#10 22.85 npm ERR! gyp ERR! command "/nix/store/kr6p8nmj3y4wmfm3q6f0j8yd2zb2lxaj-nodejs-18.20.2/bin/node" "/nix/store/kr6p8nmj3y4wmfm3q6f0j8yd2zb2lxaj-nodejs-18.20.2/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
#10 22.85 npm ERR! gyp ERR! cwd /app/node_modules/usb
#10 22.85 npm ERR! gyp ERR! node -v v18.20.2
#10 22.85 npm ERR! gyp ERR! node-gyp -v v10.0.1
#10 22.85 npm ERR! gyp ERR! not ok
#10 22.85
#10 22.85 npm ERR! A complete log of this run can be found in: /root/.npm/_logs/2024-09-28T23_49_28_468Z-debug-0.log
GitHub
GitHub - nodejs/node-gyp: Node.js native addon build tool
Node.js native addon build tool. Contribute to nodejs/node-gyp development by creating an account on GitHub.
Solution:Jump to solution
fixed with a bit of CI/CD knowledge and ChatGPT
```toml
[phases.setup]
nixPkgs = ['...', 'python3']
...
4 Replies
Project ID:
4f548b15-5b04-4552-9de0-f3c3f7c99424
4f548b15-5b04-4552-9de0-f3c3f7c99424
so I guess I have to install python.. but how?
I guess there's a configuration file somewhere
need to create a nixpacks.toml if I remember
Solution
fixed with a bit of CI/CD knowledge and ChatGPT
can close the ticket now, thx