#Node Version
332 messages · Page 1 of 1 (latest)
Project ID: N/A
N/A
- set
engines.nodeto 18 in your package.json - https://nixpacks.com/docs/providers/node#setup - nixpacks should detect you are using canvas and add the needed system packages - https://github.com/railwayapp/nixpacks/blob/main/src/providers/node/mod.rs#L132
- i can provide you with a config to add ffmpeg if you want
Thanks for helping me
yes pls give me the config
also i can use node 16? cause 18 have problems with canvas
add this as a nixpacks.toml file to your project
[phases.setup]
nixPkgs = ["...", "ffmpeg"]
node 16 is the default - https://nixpacks.com/docs/providers/node#setup
should i put engines in the package.json file
oh nvm
i just realized
node 16 is the default so that's not really necessary
and even so, you can only specify a major version - https://nixpacks.com/docs/providers/node#setup
oh ok
i hope it works
what are you deploying, if you don't mind me asking
ofc it's a discord bot
for designers
it can do some stuff for designers
like get image colors
or convert gif to mp4
sounds cool, I hope it works too
so far so good
Indeed, show me a screenshot of the table at the top of the build logs please
if you want let me screen share for you iin voice
I'm good with screenshots
alright
but you have to send the screenshots I ask for
that is not what I asked for unfortunately
ye but i don't get what part exactly you want
where should i go
the table at the top of the build logs
this would involve scrolling up the build logs to the top
im in the top
there would normally be a table there
hmm
you can join the project?
what was that for?
please don't do that
i can make you join the project? so you can see?
no thank you
replace your current nixpacks.toml file with this
[phases.setup]
nixPkgs = ["...", "ffmpeg", "libuuid", "libGL"]
is this what you want?
yes it is
good
you are using puppeteer?
yes im am
can i ask what you are using that for?
if you know favocolor website
im just getting informations for a color from this website
is there a problem with that?
it would fall under web scraping and its generally discouraged in favor of using an official api, but you are getting colours from a website, youre fine
i changed the file like this and im redeploying
i hope it works now
yes
they dont have an api
I know, but I'm sure someone has an api for what this website does, or implement it in pure JavaScript yourself, either way no big deal
oh no i searched so much
anyway
it just for one command
that's the table now
more things are now there, that's a good sign
you must not be using the canvas package directly? otherwise nixpacks should have detected it
3 minutes lol
no im using canvas package directly
yeah remember when I said it's far slower, it's slower in more ways then one lol
oh well, nixpacks has a little bug, what's new
fine, no more nix packages, we are moving to apt packages now
you know what to do
[phases.setup]
aptPkgs = ["...", "ffmpeg", "libuuid1", "libgl1", "libgl-dev"]
indeed
absolutrly
im checking something
i put console.log(process.version)
let check node version
oh ye im dumb
im preping the next thing we will try, hold tight
alr
if i run it locally it can help?
no
tthey say remove nodemodules
and nstall again
idk
anyway
im waiting you
you are doing something with opencv too?
what is this
i dont even wanna get into that lol
lol
u have another thing to do?
ok
full build logs please
-----
> [2/7] RUN apt-get update && apt-get install -y --no-install-recommends ffmpeg libuuid1 libgl1 libgl-dev:
#6 1.327 Err:12 http://deb.debian.org/debian stretch-updates/main amd64 Packages
#6 1.327 404 Not Found
#6 1.331 Reading package lists...
#6 1.345 W: The repository 'http://security.debian.org/debian-security stretch/updates Release' does not have a Release file.
#6 1.345 W: The repository 'http://deb.debian.org/debian stretch Release' does not have a Release file.
#6 1.345 W: The repository 'http://deb.debian.org/debian stretch-updates Release' does not have a Release file.
#6 1.345 E: Failed to fetch http://security.debian.org/debian-security/dists/stretch/updates/main/binary-amd64/Packages 404 Not Found
#6 1.345 E: Failed to fetch http://deb.debian.org/debian/dists/stretch/main/binary-amd64/Packages 404 Not Found
#6 1.345 E: Failed to fetch http://deb.debian.org/debian/dists/stretch-updates/main/binary-amd64/Packages 404 Not Found
#6 1.345 E: Some index files failed to download. They have been ignored, or old ones used instead.
-----
Dockerfile:3
-------------------
2 |
3 | >>> RUN apt-get update && apt-get install -y --no-install-recommends \
4 | >>> ffmpeg \
5 | >>> libuuid1 \
6 | >>> libgl1 \
7 | >>> libgl-dev
8 |
-------------------
ERROR: failed to solve: process "/bin/sh -c apt-get update && apt-get install -y --no-install-recommends ffmpeg libuuid1 libgl1 libgl-dev" did not complete successf
try this instead
keep in mind I don't have your code to test with, so I'm just guessing here
don't worry about that right now, try the new dockerfile I just sent
#10 [6/6] RUN npm ci --omit=dev
#10 0.845 npm ERR! The `npm ci` command can only install with an existing package-lock.json or
#10 0.845 npm ERR! npm-shrinkwrap.json with lockfileVersion >= 1. Run an install with npm@5 or
#10 0.845 npm ERR! later to generate a package-lock.json file, then try again.
#10 0.853
#10 0.853 npm ERR! A complete log of this run can be found in:
#10 0.853 npm ERR! /root/.npm/_logs/2023-07-01T09_32_32_729Z-debug.log
#10 ERROR: process "/bin/sh -c npm ci --omit=dev" did not complete successfully: exit code: 1
-----
> [6/6] RUN npm ci --omit=dev:
#10 0.845 npm ERR! The `npm ci` command can only install with an existing package-lock.json or
#10 0.845 npm ERR! npm-shrinkwrap.json with lockfileVersion >= 1. Run an install with npm@5 or
#10 0.845 npm ERR! later to generate a package-lock.json file, then try again.
#10 0.853
#10 0.853 npm ERR! A complete log of this run can be found in:
#10 0.853 npm ERR! /root/.npm/_logs/2023-07-01T09_32_32_729Z-debug.log
-----
Dockerfile:17
-------------------
15 | RUN rm -rf node_modules
16 |
17 | >>> RUN npm ci --omit=dev
18 |
19 | CMD ["npm", "run", "start"]
-------------------
ERROR: failed to solve: process "/bin/sh -c npm ci --omit=dev" did not complete successfully: exit code: 1
do you all of a suddon not have a package-lock.json file??
ye i removed that i though mayeb it cause problems
ill return it
i did not tell you to do that, you gotta run those kinds of things by me
sorry
okay
run npm i --package-lock-only to bring it back
ill just install the packages again
bruh
lol
i already run the command before u saod ur msg
didnt know about that cmd
it's ok npm is fast
okay push your changes
you just said npm was fast
the command i gave you does not download all the packages again
ye im dumb
:'
biting my tongue
lol
i like ur sense of humor
npm: u said im fast
why it's taking so loong lol
you sure like using outdated tech, npm 16 and deprecated packages
canvas dont work fine with node 18
says who
try use it with 18 and u will see
im built different, it would work for me
😸
but you are right, the canvas version you use from 2005 probably wouldn't work with node 18
ye it have bunch of problems
hope it works
i want to use my bot
i can show you the bot if it works if u want ofc
it is 6am for me, and i have not yet slept, unfortunately i dont have the time for a bot showcase, even in the unlikely case that this works
lol
it's 10am for me
where are you from
maple syrup
wt
wt
OMGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG
omg
omg
it worked
i can't beleive my eyes
now show me the service variables please
where is that
in the railway service
please please read this entire page sometime soon
https://docs.railway.app/develop/variables
dont know what that means, i have never developed a single line of code for a discord bot
why is that
i mean for what do
so you can stop hard coding your discord bot token, amoung other things
you mean i should put my token etc in env?
no, that's specifically what you should not do
putting your bot token in a plain text file is not a good idea
I don't even work for railway and I've already seen one too many bot tokens or database passwords because a user either stored them in the code or in a .env file
ooh
so where should i put them lol
the service variables, this is why I asked you to read that docs page I just linked
oh i see
and how i access to that in my code
I'm not just sending you things to read for funsies
ofc but i really want to thank you for helpinng me
without you ill just delete my bot lol
for example if you set a BOT_TOKEN service variable you can access that in node with process.env.BOT_TOKEN
oh thats coool
ill try that now
start over with node 18 lol
where is your database hosted
mongo db
bruh
you're something else
nice name
running locally is better
alright bedge time for me
good night sir
can I mark this thread as solved?
no problem
is this gonna be deleted
no
I figured
wait i can friend you? if doesnt bother you?
hopefully you will troubleshoot this and have it solved before I awake
lol
i hope so
sorry no, railway said I can't have any friends
@jolly spear i can't run puppeteer in railway?
You can
hmm im like getting this error
Error: Failed to launch the browser process!
you probably have to use a headless version
there's flags too have to pass the constructor
send me the code that starts puppeteer please
yes, it will pass on an embed to a channel to notify about build states
like this
they already figured that out lol
alriight sorry
const browser = await puppeteer.launch({
headless: true,
args: ['--no-sandbox', '--disabled-setupid-sandbox'],
ignoreHTTPSErrors: true,
});
and what version are you using
19.4.1
a version from december of 2022, you just love using outdated stuff dont you
you keep disappearing and making this process 10x longer then it normally would be lol
lol sry i was buying croissant 🥐 for my family
anyway I put the version 17
but it still don't work
this version npm install puppeteer@~17.1.3 --save
feel free to ping me when you come
hmm u took so long lol
this is community support, people need to keep up with their lives, just be patient :)
i know im just kidding lol
I went to sleep lol
in digitalocean with this version it work fine
oh wait ill update
put it back to 19.4.1 though, 19.4.1 works just fine
ill put latest
latest version has api changes
cool
there is no command to make it run
not install the packages from the beggining
what
railway up it push your files it also take time cause it install pckages
there is a comand like for example railway push
without installing the packages agaain
not how it works
good worked
what do you think about it?
I think you could probably find an API for colours, or implement that in code yourself, as opposed to relying on a web browser to navigate to a website for you

i think it's cool
I just really don't like scrapping sites with a web browser, it's slow and prone to failure
the bot is still cool though
im new to web scrapping i just use it fo this
but i heard cheerio is better
thanks
better? yes. the best? no, use an API lol
😭
if they have an api why ill use pupetter :-
but yeah everything works now?
YES THANKS