Re: [nodejs] how to link to installed node packages / modules from another dir

2016-10-06 Thread Zlatko
As Ryan said, you can install the "shared" modules at a common parent 
directory. So if you have /*dir1/app1 *and /*dir2/app2*, you *could* have a 
/node_modules folder with those shared directories.

However, it seems like a bad practice, updating one app might break the 
other. Are you trying to save disk space with this or reduce install time 
or something else entirely?

-- 
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 nodejs+unsubscr...@googlegroups.com.
To post to this group, send email to nodejs@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/dbfa8e78-ad12-4738-ae2c-63d3919e0772%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [nodejs] how to link to installed node packages / modules from another dir

2016-10-03 Thread Ryan Graham
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  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 nodejs+unsubscr...@googlegroups.com.
> To post to this group, send email to nodejs@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/nodejs/fa1e0949-4926-4c8f-b33f-1bfdd326b3e8%40googlegroups.com
> 
> .
> 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 nodejs+unsubscr...@googlegroups.com.
To post to this group, send email to nodejs@googlegroups.com.
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.


Re: [nodejs] how to link to installed node packages / modules from another dir

2016-10-03 Thread NodeNinja

>
>
>>>
>>> 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 nodejs+unsubscr...@googlegroups.com.
To post to this group, send email to nodejs@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/fa1e0949-4926-4c8f-b33f-1bfdd326b3e8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [nodejs] how to link to installed node packages / modules from another dir

2016-03-27 Thread Ryan Graham
On Sun, Mar 27, 2016, 2:12 PM NodeNinja  wrote:

> 1. Is this a limitation of node modules or something to do with "sqlite3" ?
>

Not a limitation, just the recommended practice. If your apps all share
their dependencies then they must all use the same versions.

2. Why didn't they allow to install once and any or multiple projects to
> link to that module?
>

I'd like to point you at some sort of canonical documentation on this, but
I can't actually think of any that fully explains the philosophy. This is
definitely a topic that falls into the tribal knowledge category. The most
often cited reason is to allow multiple incompatible versions of
dependencies to be installed, avoiding the most common cause of "dependency
hell".

3. Instead of installing the module multiple times can it be installed once
> and then the "node_modules" folder be copied to the project dir?
>

There are ways of doing this, yes, but I'm curious what problem you are
trying to solve by doing this.

~Ryan

-- 

~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 nodejs+unsubscr...@googlegroups.com.
To post to this group, send email to nodejs@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/CAGjmZGzaor43pvQSNLvkV8k%2BUXRwbje4xOpMZnBjGGq4DHL8DA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [nodejs] how to link to installed node packages / modules from another dir

2016-03-27 Thread NodeNinja


>
> Be in the root directory of your project when you run the "npm install 
> sqlite3" command, so that it gets installed in the correct directory. 
>
> You are meant to install separate copies of things for each project. 
> You're not meant to link things. 
>
> 1. Is this a limitation of node modules or something to do with "sqlite3" ?
2. Why didn't they allow to install once and any or multiple projects to 
link to that module?
3. Instead of installing the module multiple times can it be installed once 
and then the "node_modules" folder be copied to the project dir?
Regards
Aeon

-- 
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 nodejs+unsubscr...@googlegroups.com.
To post to this group, send email to nodejs@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/15242765-6661-4ea7-b4b0-667e46480542%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [nodejs] how to link to installed node packages / modules from another dir

2016-03-26 Thread Ryan Schmidt

On Mar 26, 2016, at 12:47 AM, NodeNinja wrote:

> On linux I installed sqlite3 
> 
> npm install sqlite3
> 
> sqlite3 was installed in the home directory in a folder called "node_modules"
> 
> however my server dir is different and from there I am unable to link to 
> sqlite3 unless I copy the "node_modules" folder into my server dir.
> Is there a way to link the installed "sqlite3" so that its globally 
> accessibly from any directory?
> 
> Thanks in advance.

Be in the root directory of your project when you run the "npm install sqlite3" 
command, so that it gets installed in the correct directory.

You are meant to install separate copies of things for each project. You're not 
meant to link things.

-- 
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 nodejs+unsubscr...@googlegroups.com.
To post to this group, send email to nodejs@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/3FB702D2-9BBC-4A45-8C91-4D48FB0D5983%40ryandesign.com.
For more options, visit https://groups.google.com/d/optout.


[nodejs] how to link to installed node packages / modules from another dir

2016-03-25 Thread NodeNinja
On linux I installed sqlite3 

npm install sqlite3

sqlite3 was installed in the home directory in a folder called 
"node_modules"

however my server dir is different and from there I am unable to link to 
sqlite3 unless I copy the "node_modules" folder into my server dir.
Is there a way to link the installed "sqlite3" so that its globally 
accessibly from any directory?

Thanks in advance.

-- 
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 nodejs+unsubscr...@googlegroups.com.
To post to this group, send email to nodejs@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/cfa7a403-f9ba-4b50-bd32-b4d73122f729%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.