Dependencies are loaded relative to the location of the code, not your
current working directory. If you have code in foo/dir1/proc1.js and code
in foo/dir2/proc2.js, they will both see modules in foo/node_modules
regardless of which directory you run them from (eg. `cd /bar/dir3; node
/foo/dir1/proc1.js`). Does that help?

~Ryan

On Mon, Oct 3, 2016, 6:07 AM NodeNinja <[email protected]> wrote:

>
>
> There are ways of doing this, yes, but I'm curious what problem you are
> trying to solve by doing this.
> ~Ryan
>
>
> I many node processes running and each process is running in its own
> directory.
>
> eg.
> dir1\nodeproc1, dir2\nodeproc2, .... and so on
> now each process needs access to SQLite and MySQL so for noderproc1 I
> installed sqlite and mysql in dir1\nodeproc1 folder and it made a
> node_modules folder inside that dir.
> Now  what  I do for nodeproc2, nodeproc3 and so on do I need to run
>
> npm install sqlite3
> npm install mysql
>
> I need to run the above commands again in the respective folders??
> Can't I install both the modules once and reuse it across the node
> processes running?
>
> --
> Job board: http://jobs.nodejs.org/
> New group rules:
> https://gist.github.com/othiym23/9886289#file-moderation-policy-md
> Old group rules:
> 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 unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/nodejs/fa1e0949-4926-4c8f-b33f-1bfdd326b3e8%40googlegroups.com
> <https://groups.google.com/d/msgid/nodejs/fa1e0949-4926-4c8f-b33f-1bfdd326b3e8%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
-- 

~Ryan

-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/CAGjmZGx2CCb1O2C0OesL%3DDF%3DBZbF5gx0gzw%3DdBXSUxpT0pdG_Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to