Glitch taking a while to install modules

So, I am trying to install math.js to my project, but it just takes forever for it to load into the package and it doesn’t even work in the project before it’s in the project, which is bad because I need math.js right now.

Why does it take this long to npm install something?

Hello! How long is it taking for you? It can take a while, especially if it’s an uncommon package, but excessive delay could be a sign of an issue.

Hello @Aprixia, I use package.json just fine with my project, what version of math.js are you trying to install?

I was trying to install math.js 1.1.43.
I just woke up and checked, and math.js had finally been installed. Although, the node-keepalive module, is still not installed.
Eventhough I tried to install node-keepalive first.

Hi @Aprixia sorry for the bother! Can you share the project name that’s showing this issue?

It’s XNEGNOLUSTBot
That’s the project name

Thanks for the project name. I’m not seeing node-keepalive in your package.json right now, but I think you’re also actively working on the project. Let us know if you run into further problems and we’ll take a look.

Yeah, apparently node-keepalive doesn’t show in the package, but I see it in the logs when it’s not installed and it sends a error message, but when it’s installed, it just auto starts up the bot around every 5 minutes or every time I edit the code.

The fact that the project restarts while you’re editing has to do with Glitch’s architecture and likely has nothing to do with node-keepalive. You can control this behavior with a watch.json file.

If you’re talking about https://www.npmjs.com/package/node-keepalive when you mention “node-keepalive” I should say that that package isn’t really a full solution to the keepalive problem - among other things, any time you project’s container restarts (which happens at least every ~12 hours), something will need to hit it to wake it up before the keepalive code in that package will help. Something like How to make a glitch project to run constantly? is really necessary for keeping your project always up. If you get that set up you can get rid of node-keepalive and all the code relying on it completely - it will serve no purpose.

Aside from that I think I’ve lost the thread here. Are there other problems you’re still experiencing that we can help with?

Alright, thank you.
And the uptimerobot thing, I inserted http://xnegnolustbot.glitch.me into the url/ip, but I got in my mail that it is down due to connection timeout, then I tried to go to that page in my Google Chrome browser, and I got the timeout there as well.
Should I use the edit page link? Or should I keep the link as it is?

Oh also, this is what I meant that node-keepalive is working

So, because of the way you have that set up to work with node-keepalive, http://xnegnolustbot.glitch.me/keepalive is the address that responds to your keepalive requests. If you point UptimeRobot at that url it should work better (or you can change the url if you’re going to remove node-keepalive)

Alright, I will try it out, thank you.

Yeah, just as I put it up as that, I got a mail on my phone telling me that it was back up.

Alright, thank you for the help!

And I will tell you if you console takes ages to load a npm installation into package again.

Thank you,

1 Like

It’s taking a while again…

image image

Oh, I just found out I could add it from the package.json file instantly, I didn’t know earlier.

Hello @Aprixia,

Whenever you install a new module from the console, you will have to run the refresh command to see the changes in the package.json file!

@Aprixia one other thing to note here, if you use npm then your packages take up valuable disk space in your project’s volume. If you use pnpm instead then packages are saved to shared space and don’t take up any room in your project. You can send any npm command to pnpm; if it doesn’t handle the command it just passes it to npm.

I am having this issue now. I imported my code from my repo (which is not the first time), but this time it just says installing and nothing happens. You’d see terminate in the terminal because I tried delete node_modules and restarting but to no avail