Hello, I am unable to activate my Music bot and I get an error like this :
Error: Cannot find module ‘/app/bot.js’
And my modules ;
{
“main”: “server.js”,
“scripts”: {
“start”: “node server.js”
},
“dependencies”: {
“@discordjs/opus”: “^0.3.2”,
“discord.js”: “^12.0.1”,
“simple-youtube-api”: “^5.1.1”,
“ytdl-core”: “^3.1.0”,
“ytdl-core-discord”: “^1.2.1”,
“soundcloud-downloader”: “^0.1.1”,
“express”: “^4.17.1”
},
“engines”: {
“node”: “>=12.0.0”
},
“license”: “MIT”
}
It looks like you are missing a file called bot.js.
I guess you have a line like
var something = require("./app/bot.js")
Check your file tree and make sure bot.js in inside of the folder “app”.
1 Like
Which is the folder where all the contents of your program should be.
1 Like
Because you provide a wrong path for somewhere. You can fix this by replace the let packagename to:
let bot = require('server.js')
or it is in a app folder you can just add … and it will look like this:
let bot = require('../server.js')
Regards,
SplitXPlayZ.
I try to use const for require statements so they don’t get accidentally overwritten.
Ok I think you are missing things up. You do not need to mention app
.
That’s mentioned by glitch
1 Like