Node Version
How i can change the node Version. also i can use canvas or ffmpeg in railway?
222 Replies
Project ID:
N/A
N/A
1. set
engines.node
to 18 in your package.json - https://nixpacks.com/docs/providers/node#setup
2. 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
3. i can provide you with a config to add ffmpeg if you wantThanks 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
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
og
i got this error
it's a problem with libuuid
Indeed, show me a screenshot of the table at the top of the build logs please
this?
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?
i though it give me an answer
sorry
please don't do that
i can remove that?
ye sorry didn't know about it
i can make you join the project? so you can see?
no thank you
replace your current nixpacks.toml file with this
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
Keshav Naidu
FavoColor
Hex #FF0000 Color Code
Details of hex #FF0000 color code including RGB values, CMYK, HSL, Pantone, RAL, NCS and approximate color name. Download palettes of hex code #hexcode in addition to its shades, tones and tints.
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
it is far slower and prone to issues, but meh
its harmless enough in my opinion
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
hmm
same error :'
fine, no more nix packages, we are moving to apt packages now
alr waiting you*
😸
you know what to do
table:
more things
indeed
im crying
same
nixpacks hates me
hates you too
absolutrly
im checking something
i put console.log(process.version)
let check node version
its 16
you can see that in the table
oh ye im dumb
im preping the next thing we will try, hold tight
alr
if i run it locally it can help?
no
Stack Overflow
return process.dlopen(module, path._makeLong(filename));
I am getting this error when running an example from OpenCV Node
return process.dlopen(module, path._makeLong(filename));
^
Error: /home/sunny/face/build/opencv/v5.0.0/Release/...
tthey say remove nodemodules
and nstall again
idk
anyway
im waiting you
you are doing something with opencv too?
what is this
nevermind
send me your package.json please
WHAT
sry caps
i dont even wanna get into that lol
wanna screenshot it
thats not what i meant
nevermind
lol
u have another thing to do?
no no
delete your nixpacks.toml file, and then add this file to your project
ok
full build logs please
try this instead
keep in mind I don't have your code to test with, so I'm just guessing here
hm
what coode di u want exactly
don't worry about that right now, try the new dockerfile I just sent
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 backill 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
waiting
you just said npm was fast
not my internet
lol
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
https://discord.com/channels/713503345364697088/1124606251540680727/1124636073692250163
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
just as i thought
alright im not touching that can of worms
what
anyways i heard u can connect this with discord webhook is that true
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
read the entire docs page I linked first please
no skimming!
start over with node 18 lol
😸
:)
where is your database hosted
mongo db
bruh
oh wait i get you
i think us
idk
you're something else
thats cool
nice name
running locally is better
alright bedge time for me
good night sir
can I mark this thread as solved?
yes
thanks for helping again
no problem
is this gonna be deleted
no
cool
cause i maybe i got problem again
so i msg u
youa re the best
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
oh
ok not cool from railway
@Brody 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
huh
i must be blind then
i am now blind
my bad :(
no worries
@stroos - please don't open old threads
alriight sorry
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 lolthis 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
oh cool
u slept good
and why would you try 17???? 17 is much older??
we don't want old, we want new
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
no
19.4.1 please
alr then 19.4.1
okai done
latest version has api changes
okai
whats next step
you know what to do
I have tested that with puppeteer 19.4.1 and it worked
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 agaainnot 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
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
awesome, no problem!