Works just fine for me. Observe:
c:\Users\Isaac Schlueter>mkdir socket.io-test
c:\Users\Isaac Schlueter>cd socket.io-test
c:\Users\Isaac Schlueter\socket.io-test>cat >test.js
require("socket.io")
console.log(require.resolve("socket.io"))
// press Control-D to finish
c:\Users\Isaac Schlueter\socket.io-test>mkdir node_modules
c:\Users\Isaac Schlueter\socket.io-test>npm install socket.io
npm http GET https://registry.npmjs.org/socket.io
npm http 200 https://registry.npmjs.org/socket.io
npm http GET https://registry.npmjs.org/socket.io/-/socket.io-0.8.7.tgz
npm http 200 https://registry.npmjs.org/socket.io/-/socket.io-0.8.7.tgz
npm http GET https://registry.npmjs.org/policyfile/0.0.4
npm http GET https://registry.npmjs.org/redis/0.6.7
npm http GET https://registry.npmjs.org/socket.io-client/0.8.7
npm http 200 https://registry.npmjs.org/policyfile/0.0.4
npm http GET https://registry.npmjs.org/policyfile/-/policyfile-0.0.4.tgz
npm http 200 https://registry.npmjs.org/socket.io-client/0.8.7
npm http GET
https://registry.npmjs.org/socket.io-client/-/socket.io-client-0.8.
7.tgz
npm http 200 https://registry.npmjs.org/redis/0.6.7
npm http GET https://registry.npmjs.org/redis/-/redis-0.6.7.tgz
npm http 200
https://registry.npmjs.org/socket.io-client/-/socket.io-client-0.8.
7.tgz
npm http 200 https://registry.npmjs.org/policyfile/-/policyfile-0.0.4.tgz
npm http 200 https://registry.npmjs.org/redis/-/redis-0.6.7.tgz
npm http GET https://registry.npmjs.org/websocket-client/1.0.0
npm http GET https://registry.npmjs.org/xmlhttprequest/1.2.2
npm http GET https://registry.npmjs.org/uglify-js/1.0.6
npm http 200 https://registry.npmjs.org/xmlhttprequest/1.2.2
npm http GET
https://registry.npmjs.org/xmlhttprequest/-/xmlhttprequest-1.2.2.tg
z
npm http 200 https://registry.npmjs.org/uglify-js/1.0.6
npm http 200 https://registry.npmjs.org/websocket-client/1.0.0
npm http GET https://registry.npmjs.org/uglify-js/-/uglify-js-1.0.6.tgz
npm http GET
https://registry.npmjs.org/websocket-client/-/websocket-client-1.0.
0.tgz
npm http 200
https://registry.npmjs.org/xmlhttprequest/-/xmlhttprequest-1.2.2.tg
z
npm http 200
https://registry.npmjs.org/websocket-client/-/websocket-client-1.0.
0.tgz
npm http 200 https://registry.npmjs.org/uglify-js/-/uglify-js-1.0.6.tgz
sock...@0.8.7 ./node_modules/socket.io
├── polic...@0.0.4
├── re...@0.6.7
└── socket.i...@0.8.7
c:\Users\Isaac Schlueter\socket.io-test>node test.js
c:\Users\Isaac Schlueter\socket.io-test\node_modules\socket.io\index.js
> --
> 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 nod...@googlegroups.com
> To unsubscribe from this group, send email to
> nodejs+un...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en
>>>
the 1st step: C:\Documents and Settings\xxx,cmd,nmp install socket.io
the 2cnd step: cmd,node,require("socket.io").version,display: '0.8.7'
the 3rd step: create a file a.js,write:
console.log(require("socket.io").version);
the 4th step: cmd, node d:\a.js, display: Error: Cannot find module
'socket.io'
>>>
That file has to live somewhere under C:\Documents and settings\xxx.
npm installs packages locally to the current working directory. Since
you were in C:\Documents and Settings\xxx when you installed it, it
installed in C:\Documents and Settings\xxx\node_modules. So, your
file in d:\a.js can't see it! If you move that file to C:\Documents
and Settings\xxx\a.js, then it will work. Or, you can run `d:\` and
then `npm install socket.io` to install it there, as well.
Whenever you install something with npm, it outputs the location where
it got installed to. You can only access that package if you're under
that folder somewhere.
On Sat, Dec 31, 2011 at 07:06, Shinuza <samor...@gmail.com> wrote:
> Versions of node.js and npm, please?
>