Packages keeps uninstalling somehow

#1

So, on my discord bot that I am hosting through glitch.com, the bot often somehow gets the packages uninstalled.
Multiple times, I’ve had to reinstall discord.js, node-keepalive, endb and better-sqlite3. This is pretty annoying as it ends the timeouts in the mute commands I made for the bot, which then makes the mute permanent.
I am doing pnpm install discord.js --save inside of the console, however not many hours later, it uninstalls again.
Why is this happening?
How can I prevent it from happening?

1 Like

#2

Hey @zApexio the reason your packages reinstall every so often is probably due to the expected every-12-hour restart of your project, but you shouldn’t generally need to run pnpm install commands manually. We do know that better-sqlite3 seems to encounter this problem more often than many other packages for some reason.

If you’d care to share your project name we can take a look at the specific errors your install is running into to see if there are any specific suggestions we could make.

1 Like

#3

xnegnolustbot is the name
And the packages is mainly discord.js, node-keepalive, endb and better-sqlite3

1 Like

#4

And I have to clean the cache too, forgot to mention that

1 Like

#5

Oh and, that the bot goes offline is bad too, since that ends important timeouts and those timeouts are on like weeks.
Mute timeouts, minutes, hours, days.
Strike timeouts, Warned - 1 week, Strike 1 - 2 weeks, Strike 2 - 3 weeks, Strike 3 - You’re out, ban.

1 Like

#7

So, it keeps happening, and it is frustrating as I literally have to clean the cache and then reinstall the modules manually each time.

1 Like

#8

Hello, can you please use these commands in your projects console in this order!

git prune
git gc
rm shrinkwrap.yaml
enable-pnpm

This should help clear up a little storage and maybe remove any corrupted package that was installed incorrectly and then it will reinstall all packages!

0 Likes

#9

I don’t see why the cache needs to be cleared, unless it could be that your running into out-of-disk errors.

You don’t need to re-install the modules everytime as the package.json file does that for you.

Also, if you want to keep your bot on 24/7 then consider using a free service like Uptime Robot.

1 Like

#10

@zApexio I still don’t really understand why you have to run pnpm i commands manually at all. Generally enable-pnpm (occasionally in concert with rm shrinkwrap.yaml if your package list is faulty for some reason) should be enough to let Glitch handle the install process automatically, which is the intent. Installing things manually isn’t likely to make things better, since it works around the way Glitch is supposed to work

1 Like

#11

So I just tried to do enable-pnpm, the bot had just been online for almost 24 hours, and enable-pnpm just gave me the error back… Like literally, once I did it, it just errored.

1 Like

#12

I don’t think it’s the disk.

1 Like

#13

Hey @zApexio I just took another look and it seems like your project’s running appropriately right now and that you’re actively working on it. Did you have to manually run pnpm i again to get to a working state?

I agree that it doesn’t seem likely to be a disk space issue.

0 Likes