Error: Cannot find module 'engine.io' - chat example
See original GitHub issueI have just cloned socket.io repository and tried to run example (from within socket.io/examples/chat directory) by following instructions in readme file. Unfortunately after running node .
i get this message:
module.js:340
throw err;
^
Error: Cannot find module 'engine.io'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (/home/pczyzewski/socket.io-master/lib/index.js:9:14)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
node - v0.10.28
The same thing is happend on osx and freebsd.
I am quite new to node, so it`s possible that i have omitted something.
Issue Analytics
- State:
- Created 9 years ago
- Comments:11 (2 by maintainers)
Top Results From Across the Web
Cannot find module 'engine.io' - node.js - Stack Overflow
As a general rule, don't use -g with npm install unless you are installing a command line tool. Just install the dependency right...
Read more >socket.io-client - npm
Realtime application framework client. Latest version: 4.5.4, last published: a month ago. Start using socket.io-client in your project by ...
Read more >How to solve "Error: Cannot find module '*.js'" with Node.js
If you are trying to run your Node.js application and you get something like this: Error: Cannot find module 'C:\Users\Me\my_app.js'.
Read more >engine.io - npm Package Health Analysis - Snyk
Downloads are calculated as moving averages for a period of the last 12 months, excluding weekends and known missing data points. Maintenance. Healthy....
Read more >Error: Cannot find module 'express' - YouTube
Transcript · Cannot find module '@angular-devkit/build-angular/package. · How to solve npm command error ? · How to Create a Stock Management System ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@pawski The issue is that the example app doesn’t actually depend on socket.io, but uses the relative parent. In the main
socket.io
git repo you also have to runnpm install
and that should fix the missing dependency error. Good luck! We can probably close this issue now.This is very simple to solve. In your
examples/chat
folder, open theindex.js
file and change these lines of code.before
Var io = require ('../ ..') (server);
after
Var io = require ('socket.io') (server);
And that’s it, it’s working! You do not need to run
npm
in the main folder.