Ask coding questions

← Back to all posts
meu projeto esta dando um erro
cirocaue (0)

I'm trying to make a bot that plays music on the discord, when I start this error (repl process died unexpectedly)
Can someone help me? I'm not managing to fix

Answered by 19wintersp (1120) [earned 5 cycles]
View Answer
19wintersp (1120)

Replit expects the main file to be called "index.js", you've called it "musicBot.js". Either rename it, or create a file called ".replit" and add this:

run = "node musicBot.js"
Coder100 (17090)


create a .replit file and add this:

run = "node musicBot"

the error is that you must have the file be called index.js as the entry point or you can just configure the run button.

Coder100 (17090)

That is the least important part of the error, is there *anything else you have?

Anayways, replit doesn't have the best support for music bots yet.

19wintersp (1120)

@Coder100 From the repl logs:

    throw err;

Error: ENOENT: no such file or directory, open '/home/runner/DJ-LEVi/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:1137:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
    at Module.load (internal/modules/cjs/loader.js:985:32)
    at Function.Module._load (internal/modules/cjs/loader.js:878:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
    at internal/main/run_main_module.js:17:47 {
  errno: -2,
  syscall: 'open',
  code: 'ENOENT',
  path: '/home/runner/DJ-LEVi/index.js'