Error when deploying a nextjs app
vacostin
HOBBYOP

2 years ago

#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 node-gyp@10.0.1

#10 22.85 npm ERR! gyp info using node@18.20.2 | 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

Closed

6 Replies

vacostin
HOBBYOP

2 years ago

4f548b15-5b04-4552-9de0-f3c3f7c99424


vacostin
HOBBYOP

2 years ago

so I guess I have to install python.. but how?


vacostin
HOBBYOP

2 years ago

I guess there's a configuration file somewhere


vacostin
HOBBYOP

2 years ago

need to create a nixpacks.toml if I remember


vacostin
HOBBYOP

2 years ago

fixed with a bit of CI/CD knowledge and ChatGPT

[phases.setup]
    nixPkgs = ['...', 'python3']

    aptPkgs = ['build-essential', 'libudev-dev']

vacostin
HOBBYOP

2 years ago

can close the ticket now, thx


Welcome!

Sign in to your Railway account to join the conversation.

Loading...