2 years ago
not very good at coding im just hosting this bot but it suddenly stopped working without changes
project id: a905169b-c3cb-4af1-a24e-5b5fac02d6cb
77 Replies
2 years ago
node 16 is no longer supported
2 years ago
uh what does that mean
I'm sorry but I'm not sure how I could clarify further.
how do i fix this
set your engines.node to 18 in the package.json
this is the closest thing i have in package-lock.json
and someone told me to set this to 16 and now ive changed it to 18 but it still doesnt work
2 years ago
add python to the list of providers in your service settings on railway
is it like this?
2 years ago
not quite, please look into your service settings, you will find a providers option, add python with the dropdown
ok i think got it but its still broken
2 years ago
in the future please use this -
2 years ago
are you using canvas in your project
if youre talking about this
2 years ago
nope, I'm talking about your code
2 years ago
follow the steps
2 years ago
I'll be brutally honest, it's going to be hard to host a project you don't know anything about, and by extension even harder for me to help you
yea sorry its just that its been working for like 2 years and just randomly stopped
2 years ago
you have access to the codebase right? can you send me the package.json please
2 years ago
okay thanks, I have an idea that I will put together when I'm back at the computer
2 years ago
try adding this as a railway.json file to your project -
{
"$schema": "https://railway.app/railway.schema.json",
"build": {
"builder": "NIXPACKS",
"nixpacksPlan": {
"providers": ["node"],
"phases": {
"setup": {
"nixPkgs": ["...", "python3", "gcc"],
"aptPkgs": ["...", "build-essential", "libcairo2-dev", "libpango1.0-dev", "libjpeg-dev", "libgif-dev", "librsvg2-dev"]
}
}
}
},
"deploy": {
"startCommand": "node index.js "
}
}2 years ago
im guessing you really do need node 14, but nixpacks no longer supports node 14
2 years ago
please tell me the timestamp of the last build that did work
2 years ago
year?
2 years ago
thanks, where are you obtaining this date from?
2 years ago
im sorry but thats not what i was asking for
2 years ago
i would like the timestamp for the last railway build that worked
yea i went back to railway and checked it should be the same
also i did notice the bot started failing while it was still running fine if that helps
2 years ago
okay thank you, just needed to be sure the date was from railway
2 years ago
are you able to share a link to the repo?
2 years ago
so quick question, where is the railway.json?
2 years ago
whats different about yours?
it should be the same but all the config is filled in and with the railway.json you sent
2 years ago
okay sounds good, ill try some different approaches to get this repo to deploy
2 years ago
i was able to get the repo to deploy.
Remove the railway.json and Procfile, add a Dockerfile with this in it -
FROM node:14-slim
ENV NPM_CONFIG_UPDATE_NOTIFIER=false
ENV NPM_CONFIG_FUND=false
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . ./
CMD ["node", "index.js"]2 years ago
correct
2 years ago
please use the bookmarklet
2 years ago
please send your package.json, not the package.json from the repo you sent me
2 years ago
thanks, just needed to be sure
2 years ago
copy the package.json and package-lock.json files from this repo into yours
2 years ago
what error?
2 years ago
interesting, this is proving to be difficult
it used to also spam errors like this in deploy logs but it never affected anything so i just ignored it
2 years ago
in your dockerfile change node:14-slim to node:16-slim
2 years ago
happy to help