Working with dependencies

33 views
Skip to first unread message

Ole Ersoy

unread,
Dec 31, 2013, 5:04:49 PM12/31/13
to nod...@googlegroups.com
Hi,

I was wondering whether there is a way to setup node so that all project dependencies are kept in a user repository and loaded from there?  I'd live to be able to have 2 projects, project1 and project2.  Have project 2 depend on project 1.  Then have the following workflow:

1) Update project 1
2) Install project 1 in the local repository
3) Run project 2

Project 2 will automatically get the updates from project 1 since it's reading/loading it from the local repository folder (~/.npm ... or something).

TIA and Happy New Year!
Ole

Sam Roberts

unread,
Dec 31, 2013, 5:09:44 PM12/31/13
to nod...@googlegroups.com
Its hard to understand what you mean by "depend", but check out npm
link. Sounds like it might be what you want.

Alex Kocharin

unread,
Dec 31, 2013, 5:19:31 PM12/31/13
to nod...@googlegroups.com
Hi Ole,
 
There is no such thing as "local repository".
 
If you're developing public modules, just publish them to npm registry, and run "npm update". If you're developing private modules, you might want to look at Sinopia server which provides a private npmjs registry. In any case, you will have to run "npm update" when you publish a module.
 
That said, it is possible to achieve something like that using symlinks. Just create a link from project2/node_modules/project1 pointing at project1. "npm link" does something similar.
 
 
// alex
 
01.01.2014, 02:04, "Ole Ersoy" <ole....@gmail.com>:
--
--
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
 
---
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+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ole Ersoy

unread,
Dec 31, 2013, 6:29:54 PM12/31/13
to nod...@googlegroups.com
Hi Alex and Sam,

Thanks - Those two options will definitely do the trick. I usually work with java, so I'm used to Maven which downloads all the dependencies into one central repsitory, and loads dependencies from there.

I'm curious as to whether there are any drawbacks to doing something similar with node?

Thanks again,
- Ole


On 12/31/2013 04:19 PM, Alex Kocharin wrote:
> Hi Ole,
> There is no such thing as "local repository".
> If you're developing public modules, just publish them to npm registry, and run "npm update". If you're developing private modules, you might want to look at Sinopia server which provides a private npmjs registry. In any case, you will have to run "npm update" when you publish a module.
> That said, it is possible to achieve something like that using symlinks. Just create a link from project2/node_modules/project1 pointing at project1. "npm link" does something similar.
> // alex
> 01.01.2014, 02:04, "Ole Ersoy" <ole....@gmail.com>:
>> Hi,
>> I was wondering whether there is a way to setup node so that all project dependencies are kept in a user repository and loaded from there? I'd live to be able to have 2 projects, project1 and project2. Have project 2 depend on project 1. Then have the following workflow:
>> 1) Update project 1
>> 2) Install project 1 in the local repository
>> 3) Run project 2
>> Project 2 will automatically get the updates from project 1 since it's reading/loading it from the local repository folder (~/.npm ... or something).
>> TIA and Happy New Year!
>> Ole
>>
>> --
>> --
>> 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 <mailto:nod...@googlegroups.com>
>> To unsubscribe from this group, send email to
>> nodejs+un...@googlegroups.com <mailto:nodejs+un...@googlegroups.com>
>> For more options, visit this group at
>> http://groups.google.com/group/nodejs?hl=en?hl=en
>>
>> ---
>> 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+un...@googlegroups.com <mailto:nodejs+un...@googlegroups.com>.
>> For more options, visit https://groups.google.com/groups/opt_out.
>
> --
> --
> 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
>
> ---
> You received this message because you are subscribed to a topic in the Google Groups "nodejs" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/nodejs/BBckzgnbGkw/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to nodejs+un...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages