2

I had my server working with an earlier version of node.js, npm, and socket.io but after updating I started getting issues with socket.io:

    Error: Cannot find module './lib/socket.io'
    at Function._resolveFilename (module.js:333:15)
    at Function._load (module.js:280:25)
    at Module.require (module.js:357:17)
    at require (module.js:373:17)
    at Object.<anonymous> (/usr/local/lib/node_modules/socket.io/index.js:8:18)
    at Module._compile (module.js:444:26)
    at Object..js (module.js:462:10)
    at Module.load (module.js:351:32)
    at Function._load (module.js:309:12)
    at Module.require (module.js:357:17)

i have installed socket.io module with command npm

install socket.io

which placed socket.io under node_modules in my project. I found it strange at first that the error message was saying "./lib/socket.io" but when I looked into it I found that project/node_modules/socket.io/index.js is requiring socket.io like so:

module.exports = require('./lib/socket.io');

this line giving me error Error: Cannot find module './lib/socket.io'

Please help me

Thanks in advance

2
  • try to reinstall the socket.io module also can you dump the line where you require socket.io ? Commented Apr 2, 2014 at 9:13
  • yes Phoenix i have re install socket.io many times receiving same error Commented Apr 2, 2014 at 9:14

1 Answer 1

2

Try npm cache clean I had a similar problem, and I found this tip here: http://codebetter.com/glennblock/2012/02/27/my-tale-of-npm-woe-when-all-else-fails-clear-you-cache/

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.