socketio / socket.io

Realtime application framework (Node.JS server)
https://socket.io
MIT License
61.12k stars 10.11k forks source link

problem with finding socet.io on Mac #133

Closed DmytroKopylov closed 13 years ago

DmytroKopylov commented 13 years ago

Hello! I try to run demo code from http://socket.io/ and got error: node.js:63 throw e; ^ Error: Cannot find module 'socket.io' at loadModule (node.js:275:15) at require (node.js:411:14) at Object. (/Users/dmytro/Dev/helminth/server.js:2:6) at Module._compile (node.js:462:23) at Module._loadScriptSync (node.js:469:10) at Module.loadSync (node.js:338:12) at Object.runMain (node.js:522:24) at Array. (node.js:756:12) at EventEmitter._tickCallback (node.js:55:22) at node.js:773:9

When i run npm ls installed i got this:

npm info it worked if it ends with ok npm info using npm@0.2.16 npm info using node@v0.2.6 npm@0.2.16 =isaacs active installed latest remote A package manager for node package manager m socket.io@0.6.8 =rauchg =Tim-Smart active installed latest remote The cross-browser WebSocket npm ok

So socet.io is installed. What can I do to fix this problem? Thanks!

superbobry commented 13 years ago

Have you tried installing and requiring any other packages via npm? Is socket.io the only one failing?

ryanflorence commented 13 years ago

Happening to me too, I've got express, jade, plenty of others installed via npm.

$ node -v
v0.2.6

$ npm install socket.io
npm info it worked if it ends with ok
npm info using npm@0.2.3-6
npm info install socket.io@0.6.8
npm info activate socket.io@0.6.8
npm info build Success: socket.io@0.6.8
npm ok

$ node
> var express = require('express')
> var io = require('socket.io')
Error: Cannot find module 'socket.io'
    at loadModule (node.js:275:15)
    at require (node.js:411:14)
    at cwdRequire (repl:29:10)
    at [object Context]:1:10
    at Interface.<anonymous> (repl:96:19)
    at Interface.emit (events:31:17)
    at Interface._ttyWrite (readline:309:12)
    at Interface.write (readline:147:30)
    at Stream.<anonymous> (repl:79:9)
    at Stream.emit (events:31:17)
ryanflorence commented 13 years ago

I installed node with homebrew, have two versions 0.2.0 and 0.2.6. It appears that npm is installing to the 0.2.0 directory.

ryanflorence commented 13 years ago

Eh, just got it installed in the right spot, other packages work, socket.io still not :(

sarenji commented 13 years ago

Works for me on Mac OS X 10.6 -- but I'm using node 0.3.3-pre. I wonder whether it would work if you installed 0.3.3-pre?

EDIT: Works for 0.3.8-pre as well.