Cannot find module express, even though it was working for months

Hello glitch’s community! It’s been a while since i’ve been here and im sorry to say that i came back because i saw my Discord bot was offline. I keep getting this error in console for no reason (since it was working fine for the last few months)

Error: Cannot find module 'express'
    at Function.Module._resolveFilename (module.js:548:15)
    at Function.Module._load (module.js:475:25)
    at Module.require (module.js:597:17)
    at require (internal/module.js:11:18)```
Does anyone know what this may be caused by?

Does running enable-pnpm in the console work?

2 Likes

do

pnpm r express; pnpm i express

if that does not work, then try programer’s way

No, it doesn’t
-su: enable: pnpm: not a shell builtin

when i try $ pnpm r express i get


A store server is running. All store manipulations are delegated to it.
 ERROR  EACCES: permission denied, open '/rbd/pnpm-volume/788389a3-32c6-4812-9ebe-0f26c5464b70/node_modules/dankmemes/package.json'```, 
-
and when i try
-pnpm i express 
i get 
-
A store server is running. All store manipulations are delegated to it.
Resolving: total 52, reused 47, downloaded 0
 ERROR  EACCES: permission denied, open '/rbd/pnpm-volume/788389a3-32c6-4812-9ebe-0f26c5464b70/node_modules/dankmemes/package.json'

Instead, if i do “npm i express or npm r express” it says i am missing permissions to access that file

I will try rewinding the project back a few days to see if that changes anything
(and im doing it since i did not touch it for months and now this error sadly showed up)

Update: I tried rewinding but there is still the same issue and i got this message before the error showed up

ERROR  EACCES: permission denied, symlink '../.registry.npmjs.org/@sindresorhus/is/0.14.0/node_modules/@sindresorhus/is' -> '/rbd/pnpm-volume/788389a3-32c6-4812-9ebe-0f26c5464b70/node_modules/@sindresorhus/is'
at 0/node_modules/@sindreso…```

The command you need is enable-pnpm with a hyphen; it seems like you may have used enable pnpm which is a different shell command.

Hope this helps!

2 Likes

Ahhh yes! My bad ^^ "
Works splendid now! Thanks!

1 Like