Re: nodejs in windows

114 views
Skip to first unread message

Bert Belder

unread,
Oct 5, 2012, 7:51:35 AM10/5/12
to nod...@googlegroups.com
On Friday, October 5, 2012 10:09:38 AM UTC+2, harilal pillai wrote:
hello,

Am new to node js . I have installed nodejs in C:\Program Files\nodejs . and installed socket io. I tried to create some sample application in E:\harilal\node. i got error "cannot find socket io" . after searching installed socket.io in the app folder using npm.
Now it's working fine. Is i need to install socket.io for every app separately. Is it possible to install it in node installation directory and use it in apps?

Regards
Harilal

This is a known issue. Try setting the HOME environment variable. On the command line enter
  set HOME=%USERPROFILE%

By the way, installing socket.io for every app is sort of the recommended way of doing things.

- Bert

BlondAngelNYC

unread,
Oct 5, 2012, 10:41:14 AM10/5/12
to nod...@googlegroups.com
I am a newbie myself.   I wanted to use ExpressJS for two projects.  This is what I have learned:

If you are running things from the commandline, you can use 'npm install -g <name>' to use the module.

If you are running within a webserver, you need to install it locally with 'npm install <name>'

Once I understood the distinction, then everything makes sense.

harilal pillai

unread,
Oct 6, 2012, 12:38:16 AM10/6/12
to nod...@googlegroups.com
thanks for the reply..

@ Bert Thanks for it.. 

@BlondAngelNYC    Actually am also a newbie. Just started to work with nodejs. I didn't understand the idea of running from commandline and from webserver. Could you please tell me more about it?

Regards
harilal

mgutz

unread,
Oct 7, 2012, 3:19:32 AM10/7/12
to nod...@googlegroups.com
I don't like installing anything globally since I work on multiple projects. I like each project to be self contained including the utilities it requires. For example, coffee. The workaround is to prepend

`node_modules/.bin` to PATH

This way local scripts are used if they exist. Declare command line utilities under `devDependencies` in package.json.
Reply all
Reply to author
Forward
0 new messages