When i Run the second file I get the output of the first file

When i Run the second file I get the output of the first file i tried to solve it but couldn’t pls help if anyone can :'))

Hi @NewtGaming1, welcome to the community!

What programming language are you using? Can you send the link to your Repl?

2 Likes

When you run a repl, it will default to the first program, so this is expected behavior. Another TL3 user might be able to explain the process.
OMG I WISH I HAD TEMPLATES AARRGGHH

When you run a repl, it will default to executing the shell command in the .replit file. If [interpreter] is mentioned (in the .replit file), then it will override the run command. An example would be

run = "python myfile.py"

(assuming [interpreter] field is not set). This will execute a Python script named myfile.py upon run using the python command. See the docs for more information.

is this even correct?
Edit: shouldn’tve guessed the language

I am using javascript

Can you teach me i was using javascript not python

Hey @NewtGaming1 ! What kind of JS template are you using? Node.js? React.js?

I was using node.js sir for my work

@NewtGaming1 At the files sidebar, click the 3 dots and select ‘Show hidden files’.
Then, go to the .replit file and change entrypoint to the file you want to run.

1 Like

@NewtGaming1 After that, add this:
run = "fileIWantToRun.js" above the entrypoint bit.

i have to do it everytime?

that second step is not necessary (you may just remove the run line), but you would have to change the entrypoint every time, or use a separate repl for each program, or:

3 Likes

What should i do? Of this code you sended

click the symbol in my post to collapse the quote and see the instructions

I tested it without that, changing only entrypoint, but it told me run wasn’t configured.