question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error: Cannot find module 'engine.io' - chat example

See original GitHub issue

I 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:closed
  • Created 9 years ago
  • Comments:11 (2 by maintainers)

github_iconTop GitHub Comments

10reactions
kevin-roarkcommented, Jun 3, 2014

@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 run npm install and that should fix the missing dependency error. Good luck! We can probably close this issue now.

9reactions
williaanlopescommented, Jan 14, 2017

This is very simple to solve. In your examples/chat folder, open the index.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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found