Ask coding questions

← Back to all posts
When I click run this error comes out in the console
h
BeagleSteagles

internal/fs/utils.js:269
throw err;
^

Error: ENOENT: no such file or directory, open '/home/runner/BeagleSteagles/index.js'
at Object.openSync (fs.js:462:3)
at Object.readFileSync (fs.js:364:35)
at Object.<anonymous> (/run_dir/interp.js:195:19)
at Module._compile (internal/modules/cjs/loader.js:999:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Function.executeUserEntryPoint as runMain
at internal/main/run_main_module.js:17:47 {
errno: -2,
syscall: 'open',
code: 'ENOENT',
path: '/home/runner/BeagleSteagles/index.js'
}
repl process died unexpectedly: exit status 1

Voters
BeagleSteagles
Comments
hotnewtop
SixBeeps

The error is exactly what it says it is: you don't have an index.js file in the root directory.

By default, Replit runs that file when you click on the run button and nothing else. If it isn't there, it throws that error. In order to set up the run button to run another file, you need a .replit file. Here's how to use it: https://docs.replit.com/programming-ide/configuring-run-button

BeagleSteagles

@SixBeeps I dont know anything about coding lol I am a noobie and don't know where to even start with the link given can you help me?

BeagleSteagles

@SixBeeps I have an index.js file in file src so idk what to do