Node-Gyp Error
kennierfranco
HOBBYOP

2 years 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

kennierfranco
HOBBYOP

2 years ago

logs

Attachments


2 years ago

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

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

Status changed to Solved Railway almost 2 years ago


kennierfranco
HOBBYOP

2 years 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"```


2 years 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?


kennierfranco
HOBBYOP

2 years 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


2 years ago

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


kennierfranco
HOBBYOP

2 years ago

Yeah, exactly. I just added

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

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


2 years 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.


2 years 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.


kennierfranco
HOBBYOP

2 years 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.


2 years 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?


kennierfranco
HOBBYOP

2 years ago

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


2 years ago

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


kennierfranco
HOBBYOP

2 years ago

setup │ nodejs_16, npm-8_x, python38 |


2 years ago

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


kennierfranco
HOBBYOP

2 years 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.


kennierfranco
HOBBYOP

2 years ago

Thank you Brody for your help. 🙏🏻


2 years ago

Awesome, happy to help.


Loading...