Cannot find app/server.js

#1

Hi there,

i am a new coder that trying to code a discord bot with discord js and run into some tutorials in Glitch.com hosting as well. But i seem to hit this error where discord.js is not found from my simple bot file!


there my package.json
{
“name”: “Zepetto”,
“version”: “1.0.0”,
“description”: “A tutorial bot for TxC”,
“main”: “index.js”,
“scripts”: {
“start”: “node server.js”
},
“author”: “aji”,
“license”: “ISC”,
“dependencies”: {
“discord.js”: “^11.3.0”,
“start”: “^5.1.0”,
“node-curl”: “^0.3.3”,
“server.js”: “^1.0.0”
}
}

#2

Can you please send a screenshot of your file directory!

#3

Hey @ZepettoBOT, welcome to the Glitch forum!

Your package.json is telling Glitch to start a file called server.js, but no such file exists in your project. Your package.json file also notes that the “main” file for your project is index.js, and while Glitch doesn’t do anything with the “main” file specification in package.json, I do notice that your project has an index.js file. I think if you replace server.js with index.js at https://glitch.com/edit/#!/zepetto-bot?path=package.json:7:19 your bot will start properly.

Hope this helps!