Build failed with nodejs and mysql
fred0510
TRIALOP

a year ago

I'm new here and I've been trying to deploy this api but it's always give me the same error

10 1.930 npm ERR! gyp ERR! find Python

10 1.930 npm ERR! gyp ERR! configure error

10 1.930 npm ERR! gyp ERR! stack Error: Could not find any Python installation to use

10 1.930 npm ERR! gyp ERR! stack at PythonFinder.fail (/nix/store/kr6p8nmj3y4wmfm3q6f0j8yd2zb2lxaj-nodejs-18.20.2/lib/nodemodules/npm/nodemodules/node-gyp/lib/find-python.js:306:11)

10 1.930 npm ERR! gyp ERR! stack at PythonFinder.findPython (/nix/store/kr6p8nmj3y4wmfm3q6f0j8yd2zb2lxaj-nodejs-18.20.2/lib/nodemodules/npm/nodemodules/node-gyp/lib/find-python.js:164:17)

10 1.930 npm ERR! gyp ERR! stack at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

10 1.930 npm ERR! gyp ERR! stack at async configure (/nix/store/kr6p8nmj3y4wmfm3q6f0j8yd2zb2lxaj-nodejs-18.20.2/lib/nodemodules/npm/nodemodules/node-gyp/lib/configure.js:23:18)

10 1.930 npm ERR! gyp ERR! stack at async run (/nix/store/kr6p8nmj3y4wmfm3q6f0j8yd2zb2lxaj-nodejs-18.20.2/lib/nodemodules/npm/nodemodules/node-gyp/bin/node-gyp.js:81:18)

10 1.930 npm ERR! gyp ERR! System Linux 6.1.0-25-cloud-amd64

10 1.930 npm ERR! gyp ERR! command "/nix/store/kr6p8nmj3y4wmfm3q6f0j8yd2zb2lxaj-nodejs-18.20.2/bin/node" "/nix/store/kr6p8nmj3y4wmfm3q6f0j8yd2zb2lxaj-nodejs-18.20.2/lib/nodemodules/npm/nodemodules/node-gyp/bin/node-gyp.js" "rebuild"

10 1.930 npm ERR! gyp ERR! cwd /app/node_modules/msnodesqlv8

10 1.930 npm ERR! gyp ERR! node -v v18.20.2

10 1.930 npm ERR! gyp ERR! node-gyp -v v10.0.1

10 1.930 npm ERR! gyp ERR! not ok

10 1.932

10 1.932 npm ERR! A complete log of this run can be found in: /root/.npm/logs/2024-09-19T024911147Z-debug-0.log

10 ERROR: process "/bin/bash -ol pipefail -c npm ci" did not complete successfully: exit code: 1

[stage-0 6/8] RUN --mount=type=cache,id=s/78033757-60b6-498f-a757-203690b4d9f2-/root/npm,target=/root/.npm npm ci:

1.930 npm ERR! gyp ERR! stack at async configure (/nix/store/kr6p8nmj3y4wmfm3q6f0j8yd2zb2lxaj-nodejs-18.20.2/lib/nodemodules/npm/nodemodules/node-gyp/lib/configure.js:23:18)

1.930 npm ERR! gyp ERR! stack at async run (/nix/store/kr6p8nmj3y4wmfm3q6f0j8yd2zb2lxaj-nodejs-18.20.2/lib/nodemodules/npm/nodemodules/node-gyp/bin/node-gyp.js:81:18)

1.930 npm ERR! gyp ERR! System Linux 6.1.0-25-cloud-amd64

1.930 npm ERR! gyp ERR! command "/nix/store/kr6p8nmj3y4wmfm3q6f0j8yd2zb2lxaj-nodejs-18.20.2/bin/node" "/nix/store/kr6p8nmj3y4wmfm3q6f0j8yd2zb2lxaj-nodejs-18.20.2/lib/nodemodules/npm/nodemodules/node-gyp/bin/node-gyp.js" "rebuild"

1.930 npm ERR! gyp ERR! cwd /app/node_modules/msnodesqlv8

1.930 npm ERR! gyp ERR! node -v v18.20.2

1.930 npm ERR! gyp ERR! node-gyp -v v10.0.1

1.930 npm ERR! gyp ERR! not ok

1.932

1.932 npm ERR! A complete log of this run can be found in: /root/.npm/logs/2024-09-19T024911147Z-debug-0.log

Dockerfile:20

18 | ENV NIXPACKSPATH=/app/nodemodules/.bin:$NIXPACKS_PATH

19 | COPY . /app/.

20 | >>> RUN --mount=type=cache,id=s/78033757-60b6-498f-a757-203690b4d9f2-/root/npm,target=/root/.npm npm ci

21 |

22 | # build phase

ERROR: failed to solve: process "/bin/bash -ol pipefail -c npm ci" did not complete successfully: exit code: 1

Error: Docker build failed

And here is how my package.json is

{
"name": "dahelpapi",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"serve": "nodemon server.js",
"dev": "nodemon server.js",
"start": "nodemon server.js"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"body-parser": "^1.20.2",
"cors": "^2.8.5",
"dotenv": "^16.4.5",
"express": "^4.19.2",
"jsonwebtoken": "^9.0.2",
"jwt-claims": "^1.0.1",
"msnodesqlv8": "^4.1.2",
"mysql2": "^3.9.4",
"sequelize": "^6.37.3",
"sequelize-bcrypt": "^1.2.0"
},
"devDependencies": {
"@types/node": "^20.12.7",
"nodemon": "^3.1.0"
}
}

View Deploy details

ⓘ Deployment information is only viewable by project members and Railway employees.

0 Replies

Loading...