20 days 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"
0 Replies
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.
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
?
When I run npm ci --omit=dev
locally, it works. What's wrong with running it in the Railway deployment environment?
8 days ago
Hey @Joe G, can you try passing your commands as an array such as cmds = ["npm ci --omit=dev"]
?