Node Fastify api

apronu
PRO

a year ago

When deploying the project, node isn't detected, even tho it's in the list of providers. The error I get is:

node: command not found

This happens before health check.

View Deploy details

ⓘ Deployment information is only viewable by Project members and Railway admins.

Solved

17 Replies

a year ago

Build logs please -

https://bookmarklets.up.railway.app/log-downloader/

And please share your GitHub repository.


apronu
PRO

a year ago

The providers value: ["…","go","node"]


apronu
PRO

a year ago

Here are the build & deployment logs. Thank you for the useful log-downloader.

Can't share the GitHub repo, it's private


a year ago

Would you be down to add me to the repo?


apronu
PRO

a year ago

Sorry, can't do that.

We're using NX to manage mono-repo. Previously, the app wouldn't build, as one of the apps is built in go, and while installing the dependencies, "@nx-go/nx-go" would throw as go is not installed. I've added golang as a provider, and it fixed that problem. But now node is not recognised as a command.

I've attached the package.json of the NX mono-repo.

Attachments


a year ago

No worries, for starters you are experiencing the weird phase duplication bug as denoted by the nixpacks build table, the only surefire way I am currently aware of that fixes that issue would be to delete your service and deploy into a new service, so go ahead and do that and let me know how it goes.


apronu
PRO

a year ago

Doing that.


apronu
PRO

a year ago

Just deleted and created back the service. The auto-detected provider was node, but without go the deployment failed. Then I added go and built successfully, arriving at the same deployment error.

Logs attached.


a year ago

I think I know whats going on.

This particular app that you are trying to deploy, does it depend on Go at all?


apronu
PRO

a year ago

Nope. And the package "@nx-go/nx-go" is in the dev dependencies, which I though are discarded by the installation process. But the build step fails whenever there's no go in the providers list.

I've attached the log of the first build that only had node in the providers list.

Attachments


a year ago

Okay guess it does need Go then, add Go back to the providers and then add a CGO_ENABLED service variable set to 1


Status changed to Solved Railway over 1 year ago


apronu
PRO

a year ago

Okay, this seemed to fix the error. The application has started.

Damn, thank you. I've been trying to figure this out for solid 3 hours.


a year ago

Happy to help, and now that my suggested fix has worked, some context, nixpacks has detected Go as the primary provider and by default will run the app (typically the Go app's binary) in a final slim layer that doesn't have Go build tools or anything else that was available during the build (node), aka your code was copied into an image that didn't have node.


apronu
PRO

a year ago

Yeah, got it. Seeing the "Layers" would be a helpful feature in this case. Thank you again.


a year ago

The only reason I know why this has happened is because I have read the source code of the golang nixpacks provider, so this whole debugging nixpacks process is not very user friendly to say the least.


apronu
PRO

a year ago

You're a legend man


a year ago

Haha thanks!


Node Fastify api - Railway Help Station