Failing to deploy a NestJs api in Railways UI from a Turbo monorepo
Hey all, I have a turbo monorepo repo and inside /apps/api is a NestJs api.
I want to use Railway to deploy the api (and db), however I'm struggling to get this to build with nixpacks
If I just set the directory to
apps/api
, build command to yarn run build
and start command to yarn run start:prod
from the raiway.app UI, the error it spits out says that yarn is not a command
It also does not acknowledge npm as a command.
What is the proper way to have my yarn run build
and yarn run start:prod
called from my turbo monorepo's apps/api
subfolder?4 Replies
Project ID:
5dbab68a-8e86-4f19-b758-47e6516c3028
You might find these helpful:
- Help migrating Node & Express API from heroku to Railway
- Unable to build app
- Mern App works locally, but not when deployed
⚠️ experimental feature
5dbab68a-8e86-4f19-b758-47e6516c3028
In the base case described above, the specific error is:
Also, in the terminal locally, if I run
nixpacks plan apps/api
, it outputs what looks like a successful plan, knows to setup yarn and such:
However, when I run it in the UI separately, the plan does not include the setup step. Just build & start
Oh my god I'm an idiot...
api was a separate repo. What was being pushed in this main repo was just the current commit hash of that inner repo, not the code itself. This caused a disconnect.
Deleted the inner repo and moved the old code to a regular folder of the monorepo instead, and now I get passed the issues.
Fingers crossed this was it 🤞Was this it?
hehe