Question:
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
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.
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?
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.