Why my repl.it only run "index.js" file and can not run other name file?

I have several file in replt.it
only when i put the code into “index.js” file then the file will successfully run and generate the output.
if i let repl.it to run other name file, its just doesn’t work

Repl link/Link to where the bug appears:

Screenshots, links, or other helpful context:

code snippet

In replit, the file it runs when you click the run button is determined by the entrypoint or run variable in .replit file.
In your repl here your .replit entrypoint is index.js, which when you click run it runs index.js, you can change that by changing the entrypoint variable.


please provide link to your repl next time, thank you.

(off topic, but I haven’t typed any chinese on replit for sooooo long fr lol)


thank you, you’re a real one for the bilingual answers :+1:

1 Like

thank you sooooo much!! @TaokyleYT you just gave my answer!!

i did what you told me to change the file name in .replit file
and its workssss

my another question is if my file name is in chinese, it seems doesn’t run as well.
so it only accept english name in the file name in repl.it, isn’t it?

here is my repl.it link


after researching for a bit I found this github issue describes chinese files or folders causing error, in short node js misinterpreted your filename as to 1 byte, but any text encoding method that includes chinese is 2 byte long, for example (guobao, unicode), this caused your text to be unexpectedly seperated and causing error.

Try your best not to use any character except those in the ascii table as your filename, if you need to, comment what it does inside the file and/or rename it to as descriptive name.


sure no problem! thank you for the detailed description :slight_smile:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.