17 days ago
Hi all,
i'm new to railways, nice to meet you.
I'm trying to deploy a monorepo application project, but i have the error written in the title.
The project folder is structured in this way:
root project:
-- frontend (angular application)
-- backend-go
I have configured railpack.json inside the frontend folder, this to configure the install command.
This is the railpack.json.
{
"$schema": "https://schema.railpack.com",
"steps": {
"install": {
"commands": ["npm install --legacy-peer-deps"]
},
"build": {
"inputs": [{ "step": "install" }],
"commands": ["npm run build"]
}}
}
and i have add /frontend as root project.
Any help is appreciated.
Thanks,
Marco
7 Replies
17 days ago
This thread has been opened as a bounty so the community can help solve it.
Status changed to Open Railway • 17 days ago
17 days ago
Heya. Your package.json might not be loading. Is it in your project root? Also, any reason you didn’t create these as separate services?
andywithcamera
Heya. Your package.json might not be loading. Is it in your project root? Also, any reason you didn’t create these as separate services?
17 days ago
Hey,
yes i've created 2 services one for the frontend and one for the backend, each one as setted the proper root directory in the settings tab of the service.
The package.json file is inside the frontend folder as the railpack.json file.
I'm attacching the log file
Attachments
poyel
Hey, yes i've created 2 services one for the frontend and one for the backend, each one as setted the proper root directory in the settings tab of the service. The package.json file is inside the frontend folder as the railpack.json file. I'm attacching the log file
17 days ago
Hi, I have a monorepo project too, this seems that you don't have the package.json in the right directory.
this is a SS from mi package.json, it is on my frontend root directory.
Attachments
17 days ago
So it found package-lock.json but not package.json. Is package.json committed to git? Is it blocked by .gitignore or named incorrectly perhaps? Maybe try running ‘git add frontend/package.json’ and pushing.
16 days ago
Hi All,
i tried all solution without any success.
But i found this github issue https://github.com/railwayapp/railpack/issues/211 that describe exactly the same issue.
Now i remove the install step command but the issue now is the npm install. I want to use a custom npm install command, but i am not able to find the right way now.
16 days ago
I found the solution setting RAILPACK_INSTALL_CMD as env variable and set the right command to execute.
The build was fine at the end 🙂
