Why nixpacks.toml is ignored?
ahmetso
FREEOP

10 months ago

I want to omit installing dev dependencies in prod build. Have the following nixpacks.toml in the root directory of the project. In the build logs, I can see that it runs npm ci instead of npm ci --omit=dev. Why could that be? I also can't see a line about nixpacks.toml looked, for used, or ignored because it's invalid. Any guesses or directions? Thanks!

[variables]
NODE_ENV = "production"

[phases.install]
cmd = "npm ci --omit=dev"

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

[start]
cmd = "npm start"
$10 Bounty

5 Replies

ahmetso
FREEOP

10 months ago

f751db28-1dff-4485-9579-a7141e0c9a35


ahmetso
FREEOP

10 months ago

I am suspecting my nixpacks.toml is not complete. What else should I add?

Feedback: Regardless, a log line saying nixpacks.toml is not found or not valid would be helpful.


ahmetso
FREEOP

10 months ago

Even though npm ci --omit=dev is used, it still warns saying npm warn config production Use '—-omit=dev instead.

And it still tries to install dev-only dependencies such as redis-memory-server.

Why npm thinks it's not using --omit=dev?

1394847192216244426


ahmetso
FREEOP

10 months ago

When I run npm ci --omit=dev locally, it works. What's wrong with running it in the Railway deployment environment?


10 months ago

Hey @Joe G, can you try passing your commands as an array such as cmds = ["npm ci --omit=dev"]?


Welcome!

Sign in to your Railway account to join the conversation.

Loading...