[nodejs] npm link in deployment

2013-07-08 Thread Maxim Yefremov
I have site1 and site2 on one server, they both depend on one library myLib via npm link. I changed myLib for site2 so it might be buggy for site1. How to avoid it? I want to use separate versions of myLib for site1 and site2. But when I do npm link command for myLib on server then site1 and

Re: [nodejs] npm link in deployment

2013-07-08 Thread Antoine van Wel
I don't have a good answer to your question; I think we are struggling with the same problem. IMHO "npm link" is not suitable for (y)our use case. What you really want to do is put "myLib" in your package.json dependencies, and specify a version, and specify where to fetch it from - and preferably

Re: [nodejs] npm link in deployment

2013-07-08 Thread Antoine van Wel
Thinking more about it, shouldn't this just work? - run "npm cache add ." from the myLib dir (make sure you've got the proper version set in package.json). It will "install" the package in the cache - specify "myLib": "" as a normal dependency in your project's package.json - in your project run

Re: [nodejs] npm link in deployment

2013-07-10 Thread Marco Rogers
@greelgorke is right that npm link is meant for development and not deployment. But I think I understand your problem. You have a single module repo, myLib, that you want to share between projects. I assume it's an internally developed module and not suitable for publishing to the public npm re

Re: [nodejs] npm link in deployment

2013-07-10 Thread Matt
Where is myLib hosted? Assuming git, just use git repos in your dependencies and specify a branch for each one (via #branchname). On Mon, Jul 8, 2013 at 8:09 AM, Maxim Yefremov wrote: > I have site1 and site2 on one server, they both depend on one library > myLib via npm link. > > I changed myL

Re: [nodejs] npm link in deployment

2013-07-10 Thread Maxim Yefremov
Thanx, Mat. myLib is hosted on bitbucked git repository. Allready starting to use git dependencies. It's little more time wasting in developement, but easy to deploy. On Thu, Jul 11, 2013 at 4:52 AM, Matt wrote: > Where is myLib hosted? Assuming git, just use git repos in your > dependencies an

Re: [nodejs] npm link in deployment

2013-07-12 Thread greelgorke
In addition to point 2: You can use in both project require('myLib') without path, just define NODE_PATH to the folder. but still you have to manage to different versions of the same lib. the git-dep is a better sollution here, i guess. Am Donnerstag, 11. Juli 2013 02:26:40 UTC+2 schrieb Marco

Re: [nodejs] npm link in deployment

2013-07-13 Thread Antoine van Wel
Thanks for the explanation! As for hosted private repo's - that's looking cool but don't think I'd use it since then still I've to push all modules to the cloud before building. I want to keep things local. Putting full paths in the requires, really don't want that - but NODE_PATH comes to the re

Re: [nodejs] npm link in deployment

2013-07-15 Thread greelgorke
we used a ci- server (jenkins) to do the job. it packed and uploaded to the host on every commit to the release branch. worked well. Am Samstag, 13. Juli 2013 13:35:14 UTC+2 schrieb Antoine: > > Thanks for the explanation! > > As for hosted private repo's - that's looking cool but don't think I'd