Glitch cannot find discord.js module

I was cleaning up my help command and for some reason my main server.js file logged an error of not being able to find the discord.js module, I have tried refreshing through the terminal and enable-pnpm and its still not fixed, its been like this for over 2 hours and it has caused my bot to go offline. Any one got any ideas on how I can fix this please?.

Hey @NoahsArkOfficial,

Does running enable-pnpm in the console solve the issue?

no, ive tried that several times. I have also tried npm install discord.js but still the same issue. Ive updated node but now its not finding the module discord.js but its telling me required stack within that error message
image

Is the project public, so we could take a look at it? If you’re not comfortable sharing the code, could we see the contents of the package.json file?

Try removing the line that says "node.js": "^0.0.0",

ive removed that, i hadnt noticed that was there. although it still sends back thisimage

Hm are there any errors during the install process? Usually there’s a package that’s failing to install, so the install process aborts

do you want me to install discord.js again and send what it shows?

Sure, just seeing whether there’s any errors when you’re installing discord.js or after you change package.json and all the packages get installed

It would be helpful to take a look at the whole project, but I understand if it’s private for a reason

Strange, I don’t know why that’s happening. The only thing I can point to is what looks like a very old version of npm (v2.15.12)? Maybe try running npm -v in the console and seeing whether you’re really on such an old version (newest is 6.something).

Also, try remixing the project and seeing if you run into the same issues.

thats weird, last time i knew i was using v6.x. not sure when it dropped me down to v2.x, i tried remixing and im receiving this

Try running enable-pnpm and pnpm install in the console of the remixed project. If that doesn’t work, then maybe try running npm install?

thats put me back to v6.x although it still cannot find discord.js.

weird, and running npm install discord.js@latest doesn’t install it?

when i did that, i got this

Hm, I don’t know anymore then. Looks like an issue with the integer package, which is being required by another package (but I don’t know which one)

what does that mean?

So the npm packages you install can “require” (install) other packages, just like you would. If I make a package, I can use other packages in mine, and when you install my package it also installs the ones I need to make my package work.

It looks like the error is coming from a command that the package integer is calling, "node-gyp rebuild" (you see this near the bottom right above Exit status 1. The error at the top of the screenshot (make failed with exit code: 2) originates from node-gyp, which lines up with it being integer's fault (you can see that in the filename where the error is coming from).

However, you’re didn’t install integer yourself, so I assume it’s needed for one of the packages you did install. But I don’t know which one, so I’m not really sure how to fix this :slightly_frowning_face: