#Node Version

332 messages · Page 1 of 1 (latest)

blissful ledge
#

How i can change the node Version. also i can use canvas or ffmpeg in railway?

lilac harborBOT
#

Project ID: N/A

blissful ledge
#

N/A

jolly spear
blissful ledge
#

yes pls give me the config

#

also i can use node 16? cause 18 have problems with canvas

jolly spear
#

add this as a nixpacks.toml file to your project

[phases.setup]
nixPkgs = ["...", "ffmpeg"]
blissful ledge
#

oh nvm

#

i just realized

jolly spear
#

node 16 is the default so that's not really necessary

jolly spear
#

what are you deploying, if you don't mind me asking

blissful ledge
#

for designers

#

it can do some stuff for designers

#

like get image colors

#

or convert gif to mp4

jolly spear
#

sounds cool, I hope it works too

blissful ledge
jolly spear
#

so far so good

blissful ledge
#

i got this error

#

it's a problem with libuuid

jolly spear
#

Indeed, show me a screenshot of the table at the top of the build logs please

blissful ledge
#

this?

blissful ledge
jolly spear
#

I'm good with screenshots

blissful ledge
jolly spear
#

but you have to send the screenshots I ask for

#

that is not what I asked for unfortunately

blissful ledge
#

where should i go

jolly spear
#

the table at the top of the build logs

#

this would involve scrolling up the build logs to the top

blissful ledge
jolly spear
#

there would normally be a table there

blissful ledge
#

hmm

blissful ledge
jolly spear
#

what was that for?

blissful ledge
#

sorry

jolly spear
#

please don't do that

blissful ledge
#

i can remove that?

#

ye sorry didn't know about it

blissful ledge
jolly spear
#

no thank you

#

replace your current nixpacks.toml file with this

[phases.setup]
nixPkgs = ["...", "ffmpeg", "libuuid", "libGL"]
blissful ledge
jolly spear
#

yes it is

blissful ledge
#

good

jolly spear
#

you are using puppeteer?

blissful ledge
#

yes im am

jolly spear
#

can i ask what you are using that for?

blissful ledge
#

if you know favocolor website

#

im just getting informations for a color from this website

#

is there a problem with that?

jolly spear
#

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

blissful ledge
#

i hope it works now

jolly spear
#

it is far slower and prone to issues, but meh

#

its harmless enough in my opinion

blissful ledge
jolly spear
#

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

blissful ledge
#

anyway

#

it just for one command

#

that's the table now

jolly spear
#

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

blissful ledge
#

3 minutes lol

blissful ledge
jolly spear
#

yeah remember when I said it's far slower, it's slower in more ways then one lol

jolly spear
blissful ledge
#

hmm

#

same error :'

jolly spear
#

fine, no more nix packages, we are moving to apt packages now

blissful ledge
#

alr waiting you*

#

😸

jolly spear
#

you know what to do

[phases.setup]
aptPkgs = ["...", "ffmpeg", "libuuid1", "libgl1", "libgl-dev"]
blissful ledge
#

table:

#

more things

jolly spear
#

indeed

blissful ledge
#

same

jolly spear
#

nixpacks hates me

#

hates you too

blissful ledge
#

im checking something

#

i put console.log(process.version)

#

let check node version

jolly spear
#

its 16

#

you can see that in the table

blissful ledge
#

oh ye im dumb

jolly spear
#

im preping the next thing we will try, hold tight

blissful ledge
jolly spear
#

no

blissful ledge
#

tthey say remove nodemodules

#

and nstall again

#

idk

#

anyway

#

im waiting you

jolly spear
#

you are doing something with opencv too?

blissful ledge
jolly spear
#

nevermind

#

send me your package.json please

blissful ledge
#

WHAT

#

sry caps

jolly spear
#

i dont even wanna get into that lol

blissful ledge
jolly spear
#

thats not what i meant

#

nevermind

blissful ledge
blissful ledge
jolly spear
#

no no

#

delete your nixpacks.toml file, and then add this file to your project

blissful ledge
#

ok

jolly spear
#

full build logs please

blissful ledge
#
-----
> [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
jolly spear
#

try this instead

#

keep in mind I don't have your code to test with, so I'm just guessing here

blissful ledge
#

hm

#

what coode di u want exactly

jolly spear
#

don't worry about that right now, try the new dockerfile I just sent

blissful ledge
# jolly spear 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
jolly spear
#

do you all of a suddon not have a package-lock.json file??

blissful ledge
#

ill return it

jolly spear
#

i did not tell you to do that, you gotta run those kinds of things by me

jolly spear
#

run npm i --package-lock-only to bring it back

blissful ledge
jolly spear
#

bruh

blissful ledge
#

i already run the command before u saod ur msg

#

didnt know about that cmd

#

it's ok npm is fast

jolly spear
#

okay push your changes

blissful ledge
#

waiting

jolly spear
#

you just said npm was fast

blissful ledge
#

not my internet

#

lol

jolly spear
#

the command i gave you does not download all the packages again

jolly spear
blissful ledge
#

lol

#

i like ur sense of humor

#

npm: u said im fast

#

why it's taking so loong lol

jolly spear
#

you sure like using outdated tech, npm 16 and deprecated packages

blissful ledge
jolly spear
#

says who

blissful ledge
#

try use it with 18 and u will see

jolly spear
#

im built different, it would work for me

blissful ledge
jolly spear
#

but you are right, the canvas version you use from 2005 probably wouldn't work with node 18

blissful ledge
#

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

jolly spear
#

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

blissful ledge
#

it's 10am for me

#

where are you from

jolly spear
#

maple syrup

blissful ledge
#

wt

jolly spear
#

wt

blissful ledge
#

OMGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG

#

omg

#

omg

#

it worked

#

i can't beleive my eyes

jolly spear
#

now show me the service variables please

blissful ledge
#

where is that

jolly spear
#

in the railway service

blissful ledge
jolly spear
#

just as i thought

#

alright im not touching that can of worms

blissful ledge
#

what

#

anyways i heard u can connect this with discord webhook is that true

jolly spear
jolly spear
blissful ledge
#

i mean for what do

jolly spear
#

so you can stop hard coding your discord bot token, amoung other things

blissful ledge
jolly spear
#

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

blissful ledge
#

so where should i put them lol

jolly spear
blissful ledge
#

and how i access to that in my code

jolly spear
#

I'm not just sending you things to read for funsies

blissful ledge
#

ofc but i really want to thank you for helpinng me

#

without you ill just delete my bot lol

jolly spear
#

for example if you set a BOT_TOKEN service variable you can access that in node with process.env.BOT_TOKEN

blissful ledge
#

ill try that now

jolly spear
#

read the entire docs page I linked first please

#

no skimming!

jolly spear
blissful ledge
#

:)

jolly spear
#

where is your database hosted

blissful ledge
jolly spear
#

bruh

blissful ledge
#

oh wait i get you

#

i think us

#

idk

jolly spear
#

you're something else

blissful ledge
#

thats cool

jolly spear
#

nice name

blissful ledge
jolly spear
#

alright bedge time for me

blissful ledge
jolly spear
#

can I mark this thread as solved?

blissful ledge
#

thanks for helping again

jolly spear
#

no problem

blissful ledge
#

is this gonna be deleted

jolly spear
#

no

blissful ledge
#

cool

#

cause i maybe i got problem again

#

so i msg u

#

youa re the best

jolly spear
blissful ledge
#

wait i can friend you? if doesnt bother you?

jolly spear
#

hopefully you will troubleshoot this and have it solved before I awake

jolly spear
blissful ledge
#

oh

#

ok not cool from railway

blissful ledge
#

@jolly spear i can't run puppeteer in railway?

silent crane
#

You can

blissful ledge
silent crane
#

you probably have to use a headless version

jolly spear
#

there's flags too have to pass the constructor

#

send me the code that starts puppeteer please

wooden heart
#

like this

jolly spear
#

they already figured that out lol

wooden heart
#

huh

#

i must be blind then

wooden heart
#

i am now blind

#

my bad :(

jolly spear
#

no worries

#

@blissful ledge - please don't open old threads

blissful ledge
blissful ledge
jolly spear
#

and what version are you using

blissful ledge
jolly spear
#

a version from december of 2022, you just love using outdated stuff dont you

jolly spear
#

you keep disappearing and making this process 10x longer then it normally would be lol

blissful ledge
#

anyway I put the version 17

#

but it still don't work

#

this version npm install puppeteer@~17.1.3 --save

blissful ledge
blissful ledge
#

hmm u took so long lol

wooden heart
#

this is community support, people need to keep up with their lives, just be patient :)

jolly spear
blissful ledge
#

u slept good

jolly spear
#

and why would you try 17???? 17 is much older??

#

we don't want old, we want new

blissful ledge
blissful ledge
jolly spear
#

put it back to 19.4.1 though, 19.4.1 works just fine

blissful ledge
jolly spear
#

no

#

19.4.1 please

blissful ledge
#

alr then 19.4.1

#

okai done

jolly spear
#

latest version has api changes

blissful ledge
#

whats next step

jolly spear
#

you know what to do

#

I have tested that with puppeteer 19.4.1 and it worked

blissful ledge
#

there is no command to make it run

#

not install the packages from the beggining

jolly spear
#

what

blissful ledge
#

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

jolly spear
#

not how it works

blissful ledge
#

good worked

blissful ledge
jolly spear
#

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

jolly spear
#

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

blissful ledge
#

but i heard cheerio is better

blissful ledge
jolly spear
blissful ledge
#

if they have an api why ill use pupetter :-

jolly spear
#

but yeah everything works now?

blissful ledge