Node-Gyp Error

kennierfrancoHOBBY

a year ago

Hello support!

I have a problem when trying to deploy my application related to Node-gyp and Python.

Any possible solution for this issue?

I would be very grateful if you can help me. 🙏🏻

p.s.: I attach the full logs.

Solved

18 Replies

kennierfrancoHOBBY

a year ago

logs

Attachments


a year ago

Try adding a nixpacks.toml file with this in it -

[phases.setup]
    nixPkgs = ['...', 'python38', 'gcc']

Status changed to Solved railway[bot] about 1 year ago


kennierfrancoHOBBY

a year ago

I tried it and I got the same error.

Could you help me by checking if the configuration of my nixpacks.toml file is correct?

```

nixpacks.toml

[phases.setup]
nixPkgs = ['nodejs-16_x', 'python38']

[phases.install]
script = "npm ci"

[phases.build]
script = "npm run build"

[phases.start]
script = "npm run start"```


a year ago

Why are you specifying every phase like that? is nixpacks not able to auto-detect node?

Thats also the wrong syntax for the phase commands, did an AI write this?


kennierfrancoHOBBY

a year ago

I don't know how to configure it, that's why I asked for help. Apparently I already configured it but I still have an error. Can you help me?

Attachments


a year ago

Are you now using just the nixpacks.toml file I provided?


kennierfrancoHOBBY

a year ago

Yeah, exactly. I just added

```
[phases.setup]
nixPkgs = ['…', 'python38']

[phases.install]
cmds = ['npm install']```


a year ago

I appreciate you trying things yourself, but please let's stick to the config I have provided as throwing your own settings into the mix without communicating that you have done so will only cause confusion on both our parts.


a year ago

I have updated the nixpacks.toml config I had sent in my first message, please try that, without any extra configurations and we will go from there to see if there's anything extra we need to add.


kennierfrancoHOBBY

a year ago

Thank you Brody, apparently I fixed the error. Yesterday I tried adding 'gcc' to the nixpacks.toml file but it generated again an error related to a native module so I decided to just change the install command to npm install (no need for this native module that was generating the issue) and it seems that the necessary dependencies for the application were installed correctly.


a year ago

npm install working points to issues elsewhere, you would typically want npm ci to be used instead.

What version of node do you use locally? what package manager do you use locally?


kennierfrancoHOBBY

a year ago

node: 'v16.14.2', npm: '8.5.0'


a year ago

What version of Node is your Railway deployment using? (check the build table at the top of the build logs)


kennierfrancoHOBBY

a year ago

setup │ nodejs_16, npm-8_x, python38 |


a year ago

Okay please resync your lock file and then try removing the npm install command.


kennierfrancoHOBBY

a year ago

Done. It worked with npm ci. Before committing I removed an unnecessary dependency that was indirectly installing kerberos (which was causing the issue) and updated the lock file, and it installed correctly. Now I have a new problem but it is related to the build stage, specifically with a path inside my project that I am already trying to fix.


kennierfrancoHOBBY

a year ago

Thank you Brody for your help. 🙏🏻


a year ago

Awesome, happy to help.