Ask coding questions

← Back to all posts
Keran HP
SoldadoCombine

I cant run my discord bot made with node.js and scratch for discord, in the console this is appearing:
internal/fs/utils.js:269
throw err;
^

Error: ENOENT: no such file or directory, open '/home/runner/Keran-HP/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/Keran-HP/index.js'
}

Voters
SoldadoCombine
Comments
hotnewtop
Mioun

your code shows that const keepAlive = require("./server.js") but it should be const keepAlive = require("../server.js") in the bot.js file

Coder100
  1. create a .replit file (exactly that, don't add anything else)
  2. type this in:
SoldadoCombine

@Coder100 doesnt work, and i forgot that: in the end of the error, it is: process died unexpectdly

Coder100

@SoldadoCombine you put the .replit file inside the folder. It has to be outside of any folder.