Missing discord js files

Hi. Out of nowhere my bots started to get offline.


seems that they can’t find discord.js . Is there any reasons glitch will uninstall discord.js from my project ?

I had the same problem with my first discord bot here on glitch. I thought was something from glitch servers so i waited 2 weeks , but nothing happened. My bot was still offline. Then I typed “npm install discord.js” in the console and my bot started working again. Today the other 2 bots are getting the same error.

What causing this and how can i prevent this in the future ?

I will not run npm install discord.js this time, if the glitch support wants to take a look at my project to see what causing this behavior

here is the second screenshot. New user can post only 1 screenshot per message


I typed “npm install discord.js” in console and now i dont get errors anymore, but 2 of 3 bots are still offline.

new status update: 3/3 bots are offline now.

so I added a new bot. It seems to be working, this one is online.

This may help you.

sorry, not working.

npm ERR! JSON.parse Unexpected end of JSON input while parsing near ‘’
npm ERR! JSON.parse Failed to parse package.json data.
npm ERR! JSON.parse package.json must be actual JSON, not just JavaScript.

npm ERR! A complete log of this run can be found in:
npm ERR! /tmp/npm-cache/10.15.3/_logs/2019-06-28T08_38_39_926Z-debug.log


getting this endless loading screen when i try to acces my js files.

it this caused from my browser or from glitch ?

By the looks of it, you have a formatting issue in your package.json. Nothing will work until that’s resolved. If you can share your project name I’ll take a look.

(node:3736) DeprecationWarning: TextChannel#sendMessage: use TextChannel#send instead

should i really change to TextChannel#send ?

I dont remember adding anything new to it, just one day i saw the bot not being online.

project name is painted-amethyst

please also take a look at cookie-woodpecker

this bot one day is online and one day is offline. I didnt touched his code at all

The name in package.json contained a space, which isn’t valid. With that updated the project is working again. Although you get an error due to an invalid token. For some reason you had 3 .env files in your project. If you add the variables and token to the 1 remaining .env file, then it should resolve that issue.

cookie-woodpecker has a blank .env file too - you’ll need to add the variables and token to that .env file too.

1 Like

can you see what is deleting the code in my .env file ?

I mean, is there a log file that shows when all modifications in .env were made

Just added the token, went to discord and bot was online.

Few minutes later .env file was empty again. (cookie-woodpecker)

when i switch between projects it delete my code in .env file

There’s nothing obvious in the code, and you should see any changes made in Rewind, except it doesn’t show anything new since 3 days ago.

Do you still get the same problem if you switch between projects while in an incognito or private browsing window? The projects have space, so it could be a browser plugin issue.

yes, happens also in private browser. And happens only to the .env file.

I use vivaldi on linux32 ( ubuntu 14).

I havent made any updates to browser, nor my OS , I used to have here 4 discord bots and everything worked well with this same browser&os.

Are there any ways to edit the .env file ?

When i switch between projects, i dont need to be with point of view at .env file and it will save. Seems i just have click another file before i switch to another project

All working now, thanks

1 Like

Het @r8link you were seeing the effects of the problem we mentioned in Some project .env files reset. Sorry for the bother, and glad everything’s working as expected now!

1 Like