RAILWAY_BETA_ENABLE_BUILD_V2 not respect nixpacksPlan#phases commands?

I tried builder v2 and seems like it ignore nixpacksPlan#phases#npm:config commands?
9 Replies
Percy
Percy4w ago
Project ID: 652b6038-5926-4167-a8fe-58e7d85c2888
Michael Li
Michael Li4w ago
652b6038-5926-4167-a8fe-58e7d85c2888
Brody
Brody4w ago
Please share an example nixpacks.toml file
Michael Li
Michael Li4w ago
{
"$schema": "https://railway.app/railway.schema.json",
"build": {
"builder": "NIXPACKS",
"buildCommand": "pnpm run build",
"watchPatterns": [
"apps/backend/src/*",
"apps/backend/railway.json",
"packages/**/src/*",
"packages/**/package.json",
"package.json",
"pnpm-workspace.yaml",
"pnpm-lock.yaml"
],
"nixpacksPlan": {
"phases": {
"npm:config": {
"dependsOn": ["setup"],
"cmds": [
"npm config set @repo:registry https://npm.repo.com",
"npm config set //npm.repo.com/:_authToken=${NPM_TOKEN_REPO}"
]
},
"install": {
"dependsOn": ["setup", "npm:config"]
}
}
}
},
"deploy": {
"numReplicas": 1,
"startCommand": "pnpm --filter=backend run start",
"healthcheckPath": "/health",
"healthcheckTimeout": 10,
"sleepApplication": false,
"restartPolicyType": "ON_FAILURE",
"restartPolicyMaxRetries": 10
}
}
{
"$schema": "https://railway.app/railway.schema.json",
"build": {
"builder": "NIXPACKS",
"buildCommand": "pnpm run build",
"watchPatterns": [
"apps/backend/src/*",
"apps/backend/railway.json",
"packages/**/src/*",
"packages/**/package.json",
"package.json",
"pnpm-workspace.yaml",
"pnpm-lock.yaml"
],
"nixpacksPlan": {
"phases": {
"npm:config": {
"dependsOn": ["setup"],
"cmds": [
"npm config set @repo:registry https://npm.repo.com",
"npm config set //npm.repo.com/:_authToken=${NPM_TOKEN_REPO}"
]
},
"install": {
"dependsOn": ["setup", "npm:config"]
}
}
}
},
"deploy": {
"numReplicas": 1,
"startCommand": "pnpm --filter=backend run start",
"healthcheckPath": "/health",
"healthcheckTimeout": 10,
"sleepApplication": false,
"restartPolicyType": "ON_FAILURE",
"restartPolicyMaxRetries": 10
}
}
Brody
Brody4w ago
ah this was in a railway.json, my bad can you send your build logs that use the v2 builder please - https://bookmarklets.up.railway.app/log-downloader/
Brody
Brody4w ago
and just for clarity this all works on the legacy builder and your custom phase shows up in the build table?
Michael Li
Michael Li4w ago
yes, for v1. i can see there are npm config command runs after COPY . /app/.
No description
Brody
Brody4w ago
okay, thank you very much I will forward this thread to the developer that is working on the v2 builder