I was just about to continue coding when logs said there was an error. It was saying to me:
Error: Cannot find module ‘express’
(Full error):
Error Message
module.js:540
throw err;
^
Error: Cannot find module ‘express’
at Function.Module._resolveFilename (module.js:538:15)
at Function.Module._load (module.js:468:25)
at Module.require (module.js:587:17)
at require (internal/module.js:11:18)
at Object. (/app/novus.js:2:17)
at Module._compile (module.js:643:30)
at Object.Module._extensions…js (module.js:654:10)
at Module.load (module.js:556:32)
at tryModuleLoad (module.js:499:12)
at Function.Module._load (module.js:491:3)
Problem seems to have been solved. Apparently Glitch was experiencing problems with PNPM (NPM that takes up less space) if your project is still having this problem do what etaponi said in the comments.
There are a few possible causes. Check your project isn’t out of space - run df and look at the disk space usage for /app. Failing that, problems with other dependencies can cause it too - so look for 404s or other errors. If you’re still having problems, let us know the project name and we’ll take a look. If your project is private, either make it public temporarily or DM me a join link so we can view the code. Thanks.
P Name : clienthub
I tried to do that , unfortunately didn’t do a thing.
I tried in the full console page and in the editor page in logs itself.
Both attempts worked per se , but the error hasn’t changed , it can’t find module : ‘express’.
Ah, I see the problem! If you look closely at the error messages after running enable-pnpm you’ll see that the installation is running into problems installing the version of http you’re requesting:
node v8.15.1, with pnpm
Installing...
ERROR No matching version found for http@>=0.0.1 <0.0.2
In fact, both http and fs are built into Node, so you don’t need to put them in your package.json file or install them separately. When pnpm runs into that problem it stops trying to install and therefore never installs Express, which is why your code can’t find it.
If you remove those lines from your package.json file I think you’ll have better luck.