R
Railway5mo ago
shiama

what is the solution for this error ?

when i use npm i -g @railway/cli this error appear in photo for discord bot why ??
No description
83 Replies
Percy
Percy5mo ago
Project ID: N/A
maddsua
maddsua5mo ago
just to be clear, why type of computer/os version are you running?
shiama
shiama5mo ago
computer windows 10
maddsua
maddsua5mo ago
I'd expect it to pick the x86_64 version but it goes with i686 for some reason a real quick fix for it would be downloading cli directly from github
shiama
shiama5mo ago
it needs update 64
maddsua
maddsua5mo ago
I mean it's not mac with windows on top of it or whatever?
shiama
shiama5mo ago
no not mac ok please the link of github
maddsua
maddsua5mo ago
ok, so my quick fix for it would be here: https://github.com/railwayapp/cli/releases/tag/v3.5.2 (release page) and the file that I think should be good for a modern windows pc: https://github.com/railwayapp/cli/releases/download/v3.5.2/railway-v3.5.2-x86_64-pc-windows-msvc.zip do you need assistance with setting up env PATH so that it would run in command line properly?
shiama
shiama5mo ago
yes please cuz when i click on the exe it close fast not work
maddsua
maddsua5mo ago
yeah that's how command line tools work outside of shell ok, I'm typing =) 1. Create a directory to hold this (and probably in the future other tools). I generally keep it all in C:\Users\maddsua\cli but you can use literally any directory for it, just keep in mind not to delete it and that any executable inside can be called from cmd as a command. 2. Extract railway-cli in there. if the .exe has a name with version or any other things in it just rename it to railway.exe so that it can be called from cmd by it's name 3. Now you'd need to add this entire directory to PATH environment variable. To do so follow these steps: 1. Open My computer 2. Right click and select "properties" 3. Click "advanced system settings" in top left of the window 4. Just abot Ok and Cancle buttons you'd see "environment variables". Click this one 5. Then select "path" and click "edit" 6. Paste cli directory path in there, save it all and that's it! Now doing the screenshots
maddsua
maddsua5mo ago
No description
maddsua
maddsua5mo ago
it's a good thing you're no windows, setting this up is a bit more tricky on linux HAHAHA know how it's going literally had to explain this to my friend today, but for fly.io Brody does not endorse installing cli from binary. noted.
shiama
shiama5mo ago
not work for me
maddsua
maddsua5mo ago
does it not see the executable? it may require rebooting the pc but I'm not totally sure what you can also try is opening a cmd right in the directory where railway-cli is located and calling it from there
maddsua
maddsua5mo ago
click on directory path like here, type "cmd" in there and press enter. this will open a command line inside that directory
No description
No description
maddsua
maddsua5mo ago
after that try running railway
No description
maddsua
maddsua5mo ago
if that doesn't work it's probably something wrong with file name any luck?
Brody
Brody5mo ago
I don't endorse using fly*
maddsua
maddsua5mo ago
but the frog man does....
Brody
Brody5mo ago
frog man is silly
shiama
shiama5mo ago
dont reveal bro i want to host my discord bot in railway there are steps i go on them first i should npm install for node_modules second i use this npm i -g @railway/cli from your website npm this step doesnt work with me this is all
maddsua
maddsua5mo ago
can you tell me which step is not working? is the cli not launch at all or it doesn't work from env?
shiama
shiama5mo ago
No description
shiama
shiama5mo ago
this i should take npm i -g @railway/cli and put it in terminal in visual studio and when i put it =and press enter this error occur in the photo
maddsua
maddsua5mo ago
yeah that's why I gave you steps how to install the cli without npm by downloading it directly from release page
shiama
shiama5mo ago
can you make video iam failed to do the steps
shiama
shiama5mo ago
No description
shiama
shiama5mo ago
@madhdsua
maddsua
maddsua5mo ago
oh damn npm really broke it on your pc run where railway it will show all the locations where system sees an executable called railway and just nuke the ones that were created by npm
shiama
shiama5mo ago
No description
maddsua
maddsua5mo ago
yeah you'd need to remove those in appdata/roaming/npm first
shiama
shiama5mo ago
ok
maddsua
maddsua5mo ago
it's basically just a broken install npm sometimes just does that
shiama
shiama5mo ago
i removed
shiama
shiama5mo ago
No description
shiama
shiama5mo ago
then i should do the same write railway
maddsua
maddsua5mo ago
were you able to add the path environment variable?
shiama
shiama5mo ago
one second
shiama
shiama5mo ago
No description
shiama
shiama5mo ago
.
maddsua
maddsua5mo ago
looks about right now if you run where railway what's the output?
shiama
shiama5mo ago
one second
shiama
shiama5mo ago
No description
shiama
shiama5mo ago
.
maddsua
maddsua5mo ago
interesting and just to be clear you did reboot the computer? I feel like a tech support guy rn 😂
shiama
shiama5mo ago
no i didnt
maddsua
maddsua5mo ago
oh, when you add that for the first time it won't apply until computer is restarted it's windows 🤷‍♂️
shiama
shiama5mo ago
ok i will reboot it and come
shiama
shiama5mo ago
No description
shiama
shiama5mo ago
when i removed the files npm i didnt do anything yet
maddsua
maddsua5mo ago
thonk
shiama
shiama5mo ago
and when i write railway
No description
maddsua
maddsua5mo ago
does it at least run if you launch cmd from the directory itself? like here
shiama
shiama5mo ago
like this
maddsua
maddsua5mo ago
well, Brody is a big windows boi here we need ur help I have no idea why it doesn't see the damn executable too bad can't tag him directly
shiama
shiama5mo ago
@Brody]
shiama
shiama5mo ago
No description
shiama
shiama5mo ago
done
maddsua
maddsua5mo ago
nice so what was the key?
shiama
shiama5mo ago
iam idiot the programe i made it
maddsua
maddsua5mo ago
name had a typo in it?
shiama
shiama5mo ago
railway.exe
maddsua
maddsua5mo ago
oh classic lmao
shiama
shiama5mo ago
and i wrote in cmd railway i remove .exe ....
maddsua
maddsua5mo ago
yeah got it I have extensions shown by default for situations like that
shiama
shiama5mo ago
bro when i want to make the bot run from specified file the main file i mean what should i do
maddsua
maddsua5mo ago
python, right? a lot of the time railway can automatically detect what framework is used so if there's a main.py railway will try to run it you'd just need to railway up that thing and then set a PORT variable in the dashboard to expose the app to the internet
shiama
shiama5mo ago
node.js
maddsua
maddsua5mo ago
ohhhh that's noice even better same thing but here you need the packages json to have a start command
shiama
shiama5mo ago
aha
maddsua
maddsua5mo ago
literally a script called start
shiama
shiama5mo ago
ok yes start.js
maddsua
maddsua5mo ago
doesn't matter how the module is called railway will look into package.json to find it
shiama
shiama5mo ago
ok how can i restart the bot
maddsua
maddsua5mo ago
there's a restart button in the dashboard if that's what you're looking for
shiama
shiama5mo ago
where is dashborad
shiama
shiama5mo ago
No description
shiama
shiama5mo ago
this
maddsua
maddsua5mo ago
No description
maddsua
maddsua5mo ago
click on the service
shiama
shiama5mo ago
ok is there console make me write in it
maddsua
maddsua5mo ago
nah no console
shiama
shiama5mo ago
No description