a month ago
Project ID: 5c70c098-1cf0-43a3-8216-6d4a673bfce2
I have a reicent build angular app but when I push it railway fails to build it, how can I get it to work?
Thanks in advance.
Package json:
{
"name": "lanhsahn-sis",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"watch": "ng build --watch --configuration development",
"test": "ng test"
},
"prettier": {
"printWidth": 100,
"singleQuote": true,
"overrides": [
{
"files": "*.html",
"options": {
"parser": "angular"
}
}
]
},
"private": true,
"packageManager": "npm@11.3.0",
"dependencies": {
"@angular/animations": "^21.1.2",
"@angular/cdk": "~21.1.2",
"@angular/common": "^21.1.0",
"@angular/compiler": "^21.1.0",
"@angular/core": "^21.1.0",
"@angular/forms": "^21.1.0",
"@angular/material": "~21.1.2",
"@angular/material-moment-adapter": "^21.1.2",
"@angular/platform-browser": "^21.1.0",
"@angular/router": "^21.1.0",
"angular2-notifications": "^16.0.1",
"moment": "^2.30.1",
"ngx-cookie-service": "^21.1.0",
"ngx-flexible-layout": "^21.0.0",
"ngxsmk-datepicker": "^2.0.7",
"rxjs": "~7.8.0",
"tslib": "^2.3.0"
},
"devDependencies": {
"@angular/build": "^21.1.2",
"@angular/cli": "^21.1.2",
"@angular/compiler-cli": "^21.1.0",
"jsdom": "^27.1.0",
"typescript": "~5.9.2",
"vitest": "^4.0.8"
}
}
Pinned Solution
a month ago
Since you got the error "/app/browser": not found when you switched to Railpack, you can try to solve it by modifying your angular.json file to change the outputPath of the build.
Switch back to Railpack and try this one:{
"projects": {
"lanhsahn-sis": {
"architect": {
"build": {
"options": {
"outputPath": "."
}
}
}
}
}
}
Try to change it to just browser if it doesn't work, or whatever base folder corresponds to /app/browser .
25 Replies
a month ago
Is this using Railpack? Or a Dockerfile?
a month ago
Could you switch to Railpack? Nixpacks is deprecated
You can change the Node version using the RAILPACK_NODE_VERSION env variable
In your case 22 should work
Made the changes you asked and got a new error:
copy /app/browser
0ms
ERROR: failed to build: failed to solve: failed to compute cache key: failed to calculate checksum of ref y1pgn8pxd568xbja5xn91zoyk::w1xsba7b24bhjtku3fy42w143: "/app/browser": not found
This is my first time using railpack I really don't know what to expect
a month ago
You can switch back to Nixpacks then, and use NIXPACKS_NODE_VERSION instead
Faild again, error:
stage-0
RUN npm install --legacy-peer-deps && npm run build
2s
npm warn config production Use --omit=dev instead.
npm warn EBADENGINE Unsupported engine {
npm warn EBADENGINE package: '@angular-devkit/architect@0.2101.2',
npm warn EBADENGINE required: {
npm warn EBADENGINE node: '^20.19.0 || ^22.12.0 || >=24.0.0',
npm warn EBADENGINE npm: '^6.11.0 || ^7.5.6 || >=8.0.0',
npm warn EBADENGINE yarn: '>= 1.13.0'
npm warn EBADENGINE },
npm warn EBADENGINE current: { node: 'v22.11.0', npm: '10.9.0' }
npm warn EBADENGINE }
npm warn EBADENGINE Unsupported engine {
npm warn EBADENGINE package: '@angular-devkit/core@21.1.2',
npm warn EBADENGINE required: {
npm warn EBADENGINE node: '^20.19.0 || ^22.12.0 || >=24.0.0',
npm warn EBADENGINE npm: '^6.11.0 || ^7.5.6 || >=8.0.0',
npm warn EBADENGINE yarn: '>= 1.13.0'
npm warn EBADENGINE },
a month ago
Slightly unfortunate, NIXPACKS_NODE_VERSION to 22.12
a month ago
23 it is
a month ago
I'm at a loss then
a month ago
If you have to switch off Railpack, switching to a Dockerfile would be preferred over switching back to Nixpacks.
a month ago
(Railpack is was switched to from Nixpacks)
Can you help with dockerfile template I can use I really dont understand docker
a month ago
I can't, but the community can!
a month ago
how does one takes on a bounty ? I can fix it
journeytosilius
how does one takes on a bounty ? I can fix it
a month ago
Just help the user. If you solve their problem, they will mark your message as the answer. Then, an admin will review it, and you will be awarded the bounty.
journeytosilius
how does one takes on a bounty ? I can fix it
a month ago
Hi, please help im really stuck
a month ago
Since you got the error "/app/browser": not found when you switched to Railpack, you can try to solve it by modifying your angular.json file to change the outputPath of the build.
Switch back to Railpack and try this one:{
"projects": {
"lanhsahn-sis": {
"architect": {
"build": {
"options": {
"outputPath": "."
}
}
}
}
}
}
Try to change it to just browser if it doesn't work, or whatever base folder corresponds to /app/browser .
darseen
Since you got the error "/app/browser": not found when you switched to Railpack, you can try to solve it by modifying your angular.json file to change the outputPath of the build.Switch back to Railpack and try this one:{ "projects": { "lanhsahn-sis": { "architect": { "build": { "options": { "outputPath": "." } } } } }}Try to change it to just browser if it doesn't work, or whatever base folder corresponds to /app/browser .
a month ago
This is the structure when built, if it helps
Attachments
fcaceres98
This is the structure when built, if it helps
a month ago
In this case, change the outputPath to ".". This way Angular will create the browser folder in your project root. You will need to add browser to .gitignore so you don't push build outputs to your repo.
a month ago
I made the changes you said but railway its not deploying the github repo
Attachments
fcaceres98
I made the changes you said but railway its not deploying the github repo
a month ago
The image you provided shows that you haven't changed the outputPath to "." !
a month ago
If changing the outputPath doesn't work, keep it as it was, and try setting RAILPACK_BUILD_CMD to npm run build && mv dist/lanhsahn-sis/browser . in your environment variables.
a month ago
"options": {
"outputPath": "dist/lanhsahn-sis/browser",
}and setting the Build to railpack, did work
Attachments
Status changed to Solved brody • about 1 month ago


