Your link to the example does not work but I could believe that you have to
change the module paths when copying the example:
In the project repo of the lib:
var websocket = require('../lib/index');
but when installed with npm
var websocket = require('websocket');
On Monday, February 11, 2013 11:13:31 AM UTC+1, umen wrote:
>
> im new to this , i installed the nodejs with the installer in windows.
> then i installed the WebSocket-Node
> <https://github.com/Worlize/WebSocket-Node>module with this command:
> npm install websocket , looks like successful install .
>
> npm http GET https://registry.npmjs.org/websocket
> npm http 200 https://registry.npmjs.org/websocket
> npm http GET
> https://registry.npmjs.org/websocket/-/websocket-1.0.8.tgz
> npm http 200
> https://registry.npmjs.org/websocket/-/websocket-1.0.8.tgz
>
> > [email protected] install
> D:\dev\html5\books\bumper\node_modules\websocket
> > node install.js
>
> [websocket v1.0.8] Attempting to compile native extensions.
> [websocket v1.0.8] Native extension compilation successful!
> [email protected] node_modules\websocket
>
>
> it installed the nodejs in this location :
>
> > c:\Program Files (x86)\nodejs\
>
> now i try to execute the server.js example from [
> https://github.com/Worlize/WebSocket-Node][1]
> im getting this error:
>
> D:\dev\html5\books\bumper>node server.js
>
> module.js:340
> throw err;
> ^
> Error: Cannot find module '/path/to/websocket'
> at Function.Module._resolveFilename (module.js:338:15)
> at Function.Module._load (module.js:280:25)
> at Module.require (module.js:362:17)
> at require (module.js:378:17)
> at Object.<anonymous> (D:\dev\html5\books\bumper\server.js:3:23)
> at Module._compile (module.js:449:26)
> at Object.Module._extensions..js (module.js:467:10)
> at Module.load (module.js:356:32)
> at Function.Module._load (module.js:312:12)
> at Module.runMain (module.js:492:10)
>
>
> also the module is installed in the project root did not in the nodejs dir
> , is it ok?
>
>
>
--
--
Job Board: http://jobs.nodejs.org/
Posting guidelines:
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en
---
You received this message because you are subscribed to the Google Groups
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.