Console not workinf

i just created a another file name as string.js
but when i run the program inside my file console is not showing output
i need help with this.

By default, replit runs index.js on node repls.
To change it,

  1. click on the 3 dots above the file sidebar
  2. Show hidden files
  3. Go to .replit file
  4. Change run = "node index.js" to run="node <your file path>"

You may refer this https://docs.replit.com/programming-ide/configuring-repl

2 Likes

Hey, @omsingh32, welcome to Ask. You can manually run node string.js in Shell. Note that pressing the run button will run index.js, not string.js. You will have to do that command each time you want to run it. Regard @QuantumCodes’s answer if you want it to be more permanent. That will mean the run button will always start string.js.

2 Likes

Hey @omsingh32, welcome to the community!

Just click the three dots then click “Show hidden files”. Next click on the .replit file and finally you can change the entrypoint to whatever file you want to run.

Images (in Python, but works for other languages too)

Dots

Show hidden files

edited

Also see the docs on how to configure a Repl: https://docs.replit.com/programming-ide/configuring-repl

2 Likes