简体   繁体   中英

Error: main.js:1 Uncaught Error: Cannot find module 'http'

The http module is baked into Node.js, right? So require('http'); has to work, right? Then why does this fail?

var httpSumo = require('http');

seems to result in this error:

main.js:1 Uncaught Error: Cannot find module 'http'

Might there be something in a configuration someplace that's preventing it from loading? I've done this before. It has always worked, but here I'm forking from someone else's git.

I can't believe I didn't see this before, but the component that's failing is client side, not server side. So of course it can't open a socket. d'oh... that' explains it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM