Ah!

Ronnie, a key point to understand require (and npm work) is:

http://nodejs.org/api/modules.html#loading_from_node_modules_Folders

lookup at
Loading from node_modules
Folders#<http://nodejs.org/api/modules.html#modules_loading_from_node_modules_folders>

If the module identifier passed to require() is not a native module, and
does not begin with '/', '../', or'./', then node starts at the parent
directory of the current module, and adds /node_modules, and attempts to
load the module from that location.

Another good resource is:
http://www.bennadel.com/blog/2169-Where-Does-Node-js-And-Require-Look-For-Modules-.htm

BUT WARNING: require.paths doesn't exist anymore. It was removed in Node
0.5.x (AFAIK)

The final piece to understand require, at the first link:
Loading from the global
folders#<http://nodejs.org/api/modules.html#modules_loading_from_the_global_folders>

If the NODE_PATH environment variable is set to a colon-delimited list of
absolute paths, then node will search those paths for modules if they are
not found elsewhere. (Note: On Windows, NODE_PATH is delimited by
semicolons instead of colons.)
If you can install something complex, like

npm install nodeunit

you will see that node_modules/nodeunit has another node_modules subfolder!
Russian dolls! ;-)

Well, nodeunit inside code require(...) USES the noneunit/node_modules
subfolder for its own dependencies.

This way of package search is very useful and interesting. Maybe, it's a
new way to Ruby developers, or NuGet users. It avoid some version
collisions.

If you run

npm install -g nodeunit

the module is usually installed into your user folder. In my case, in

<myuserfolder>/AppData/Roaming/npm

Your PATH should be point to this folder (usually, the .msi did this work).

In such way, the new module can install line commands. In my case, I have
nodeunit.cmd in this folder.

After resolving your npm install issue, try a global install with great
output:

npm install -g geddy

http://geddyjs.org/

and check if that roaming directory there is a new geddy.cmd

Hope all this helps, enjoy!

On Mon, Jun 4, 2012 at 6:29 AM, Rohit Singh <[email protected]> wrote:

>
> try running it as admin. I guess it might help.
>
> On Mon, Jun 4, 2012 at 2:56 PM, Ronnie <[email protected]> wrote:
>
>> Hi Srirangan,
>>
>> I ran many times , the same error repeated.
>>
>> Can you / any one guide on how to run an assynchronous file upload
>> application using node.js in windows machinestep by step.
>>
>> Thanks in advance.
>>
>> On Jun 4, 2:19 pm, Srirangan <[email protected]> wrote:
>> > I see this occasionally on Ubuntu. Just re-run the command.
>> >
>> > Srirangan  |  +91 9711 477 595  |  About <http://srirangan.net/about>
>> > GitHub <https://github.com/Srirangan>
>> > LinkedIn<http://www.linkedin.com/in/srirangan>
>> >   Twitter <http://twitter.com/srirangan>  |  Review19
>> > <http://review19.com>  "Collaborate
>> > & Track Decisions"
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> > On Mon, Jun 4, 2012 at 2:48 PM, Ronnie <[email protected]> wrote:
>> > > I ran the npm install commnad and got the following exception:
>> >
>> > > npm http GEThttps://github.com/isaacs/ronnjs/tarball/master
>> > > npm ERR! failed to fetchhttps://
>> github.com/isaacs/ronnjs/tarball/master
>> >
>> > > npm ERR! Error: getaddrinfo ENOENT
>> > > npm ERR!     at errnoException (dns.js:31:11)
>> > > npm ERR!     at Object.onanswer [as oncomplete] (dns.js:140:16)
>> > > npm ERR! You may report this log at:
>> > > npm ERR!     <http://github.com/isaacs/npm/issues>
>> > > npm ERR! or email it to:
>> > > npm ERR!     <[email protected]>
>> > > npm ERR!
>> > > npm ERR! System Windows_NT 5.1.2600
>> > > npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program
>> > > Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "instal
>> > > npm ERR! cwd C:\Program Files\nodejs\node_modules\npm
>> > > npm ERR! node -v v0.6.18
>> > > npm ERR! npm -v 1.1.21
>> > > npm ERR! syscall getaddrinfo
>> > > npm ERR! code ENOTFOUND
>> > > npm ERR! message getaddrinfo ENOENT
>> > > npm ERR! errno {}
>> > > npm ERR!
>> > > npm ERR! Additional logging details can be found in:
>> > > npm ERR!     C:\Program Files\nodejs\node_modules\npm\npm-debug.log
>> > > npm not ok
>> >
>> > > What is the problem?
>> >
>> > > Please help on this regard!
>> >
>> > > On Jun 4, 1:28 pm, Ronnie <[email protected]> wrote:
>> > > > Thanks , can you guide me on this.
>> >
>> > > > I have installednode-v0.6.18.msi exe and thenodehas been installed
>> > > > in
>> >
>> > > > C:\Program Files\nodejs .
>> >
>> > > > What next ?
>> >
>> > > > How to run the npm install command?
>> >
>> > > > Plese guide.
>> >
>> > > > Hello world is running.
>> >
>> > > > On Jun 4, 1:19 pm, yogesh agrawal <[email protected]> wrote:
>> >
>> > > > > multipart module is not in node_modules.
>> >
>> > > > > install it by using npm install command
>> >
>> > > > > On Mon, Jun 4, 2012 at 1:46 PM, Ronnie <[email protected]> wrote:
>> > > > > > Hi,
>> >
>> > > > > > I am successfull in running the hello world app.
>> >
>> > > > > > Now I am trying to run some other app and getting the following
>> > > > > > error .
>> >
>> > > > > > module.js:337
>> > > > > >    thrownewError("Cannot find module '" + request + "'");
>> > > > > >          ^
>> > > > > > Error: Cannot find module 'multipart'
>> > > > > >    at Function._resolveFilename (module.js:337:11)
>> > > > > >    at Function._load (module.js:279:25)
>> > > > > >    at Module.require (module.js:359:17)
>> > > > > >    at require (module.js:375:17)
>> > > > > >    at Object.<anonymous> (C:\upload.js:2:17)
>> > > > > >    at Module._compile (module.js:446:26)
>> > > > > >    at Object..js (module.js:464:10)
>> > > > > >    at Module.load (module.js:353:31)
>> > > > > >    at Function._load (module.js:311:12)
>> > > > > >    at Array.0 (module.js:484:10)
>> >
>> > > > > > Please help in this regard!
>> >
>> > > > > > Thanks in advance.
>> >
>> > > > > > On Jun 4, 11:49 am, Ronnie <[email protected]> wrote:
>> > > > > > > Hi ,
>> > > > > > > I am verynewinnodejs . I have installednode-v0.6.18.msi in my
>> > > > > > > local windows machine.
>> >
>> > > > > > > I am unabl eto run a hello world program.
>> >
>> > > > > > > Could you please help me in this respect!
>> >
>> > > > > > > Thanks in advance.
>> >
>> > > > > > --
>> > > > > > 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
>> >
>> > > > > --
>> > > > > Yogesh Agrawal
>> > > > > +91-9351507770
>> >
>> > > --
>> > > 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
>>
>> --
>> 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
>>
>
>
>
> --
> Rohit Singh
> +91-9958563916
>
>  --
> 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
>

-- 
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

Reply via email to