Nixpacks ignores root "pnpm-lock.yaml" and runs "npm i"
I have "pnpm-lock.yaml" in my root directory, but Nixpack s runs "npm i" to install dependencies.
Please help.
Solution:Jump to solution
for a turbo repo, you want to first have two sets of build and start commands in your package.json (at the root), for example (for the backend) a
build:backend
that only builds the backend, and a start:backend
that only starts the backend, you leave the root directory service setting empty, and then set those two build and start commands in the service settings, pnpm run
build:backend and
pnpm run start:backend
59 Replies
Project ID:
ff888312-fff1-42e2-bb27-6d6f628e7d3b
ff888312-fff1-42e2-bb27-6d6f628e7d3b
do you also have a package lock file?
There is a bug in the "backend" service and the "yeondocs-web" service.
no
Never
do you have your root directory set to a subfolder in the service settings?
Both the "backend" service and the "yeondocs-web" service have root directories set in settings.
Solution
for a turbo repo, you want to first have two sets of build and start commands in your package.json (at the root), for example (for the backend) a
build:backend
that only builds the backend, and a start:backend
that only starts the backend, you leave the root directory service setting empty, and then set those two build and start commands in the service settings, pnpm run
build:backend and
pnpm run start:backend
I'll try it
Oh nixpacks run "pnpm i " finally
Thanks
did you already have those two scripts I mentioned?
Yes
ah cool, so you where already like 90% of the way there
The problem was only because the root directory was set.
Thank you very much
yeah railways docs on monorepos could be better
It was my mistakes.
you can also use watch paths so that you don't trigger a new build of the backend when pushing frontend code to github, or vice versa
https://docs.railway.app/deploy/builds#watch-paths
what kind of app is the yeondocs-web app?
" yeondocs-web" is a web app for frontend.
hosted on railway too?
yeah
vite?
No Next.js app
ah cool, then you're all set, I was asking because railway doesn't have great support for static spa apps, but all good since it's next
Thank you so much for your kind reply
no problem 🙂
might be a dumb question but what would the
build:<appname>
and start:<appname>
commands in the root package.json look like? My turborepo apps only have a build
command...i could be wrong, im not a js dev, but i think turbo has a filter flag that will allow you to run specific scripts within a given package/app
yea the command is just
pnpm turbo build --filter=appname
perfect, use that kind of syntax in your
build:<appname>
and start:<appname>
commandsoh wait I see... we want this command as a script in the root
yes
alright let me try some things
I need a start command but im not sure what that start command is supposed to be 😅
let's see what you have for your scripts in the package.json at the root of your project?
I did a little more figuring out and this is going to sound pretty cursed but there is a dotnet app in the apps directory of the turbo repo... so Nixpacks is trying to build that instead of detecting the turbo.json... I think I need to tackle this before I move any further.
that is cursed, you do still have the root directory set to / right?
yea
or maybe I have to do some railway configuration magic?
do you have dotnet stuff in the root of your repo?
no it's a actually in the directory
/apps
so why would railway know about that unless you set the root directory to /app?
railway doesn't check the subdirectories
that's what im trying to figure out right now
if you have the service's root directory set to
/
then you must have something in the root thats making nixpacks think its a dotnet appthis is where my brain is right now
or you have overridden the providers list somewhere
i have no idea what that is 😅
fair, but that doesn't mean you haven't changed them
how do i see the providers list?
service settings most likely
its should be in the build section section in the service settings but it's hidden... I see it in the DOM but it isn't visible. Is this because Nixpacks is the default builder?
probably because you're not beta
open the command pallet and search for join
what is the command pallet?
ctrl / cmd + k
oh got it
i joined i think
you did
providers is still hidden for me but breifly revealing it shows Node
what does the build table show?
the build table is in the build logs
do you think you could open a new help thread for this?
sure thing