#Is there a way to pass an extra flag to the `install` command?

22 messages · Page 1 of 1 (latest)

empty pine
#

Is there a way in Nixpacks to pass an extra flag? For example, I would like to skip the postInstall when running pnpm install and add the --ignore-scripts flag.

Is there a way to do that in railway.toml?

uneven pastureBOT
#

Project ID: 660f85e6-f8fa-467e-8c57-d93f8eb3304e

empty pine
#

660f85e6-f8fa-467e-8c57-d93f8eb3304e

quasi loom
#

to give me a better idea of what currently happens show me the table at the top of the build logs

empty pine
#

What happens is, in a monorepo, a build will fail in a situation like this:

Project A

  • ENV: a,b

Project B

  • ENV: c

The postinstall script will run all the time for every project in the monorepo. If the postinstall script expect env a,b then Project B will always fail during the postinstall phase.

#

I'd like to add after --frozen-lockfile the flag --ignore-scripts

quasi loom
#

yeah we can do that

empty pine
#

how?

quasi loom
#

not at my computer at the moment unfortunately

#

can you provide me with your current railway.json file, if you dont have one in your project you can find it in the details tab of your latest deployment

empty pine
#

This is the toml file at the moment:

[build]
builder = "nixpacks"
buildCommand = "pnpm directus:build-extensions"
watchPatterns = ["apps/directus/**", "pnpm-lock.yaml", "directus-extensions/**"]

[deploy]
startCommand = "pnpm directus:apply-schema && pnpm directus:start"
restartPolicyType = "on_failure"
restartPolicyMaxRetries = 5
quasi loom
#

did you have that as a file in your project

#

@empty pine

empty pine
#

yes

quasi loom
#

well i only know how to do this with railway.json, so i hope you dont have an attachment to toml

empty pine
#

I can try json

quasi loom
#

im doing that for you

#

delete your railway.toml file and use this railway.json file instead

{
  "$schema": "https://railway.app/railway.schema.json",
  "build": {
    "builder": "NIXPACKS",
    "buildCommand": "pnpm directus:build-extensions",
    "watchPatterns": ["apps/directus/**", "pnpm-lock.yaml", "directus-extensions/**"],
    "nixpacksPlan": {
      "phases": {
        "install": {
          "cmds": ["npm install -g corepack", "corepack enable pnpm i --frozen-lockfile --ignore-scripts"]
        }
      }
    }
  },
  "deploy": {
    "startCommand": "pnpm directus:apply-schema && pnpm directus:start",
    "restartPolicyType": "ON_FAILURE",
    "restartPolicyMaxRetries": 5
  }
}
empty pine
#

oh ok, I see. thx I'll try that

quasi loom
#

yeah just check the build table to make sure the command is what you want and if everything is in the right order

#

think it goes without saying, but the railway.json i provided was untested by me