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": "<version>" as a normal dependency in your project's package.json - in your project run npm install myLib Now this does not work, but gives an error that the package is not in the npm registry. But hey, it's in the cache - why is it checking the registry in the first place? I would not expect that since I'm directly specifying a version which is in the cache. npm version 1.2.32 node version 0.10.12 Antoine On Mon, Jul 8, 2013 at 3:23 PM, Antoine van Wel <[email protected]>wrote: > 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 in such a way > that this works in both development flows and production flows. > > So looking at the options from there.. Seems like you can specify git > repo's directly in your dependencies. Well I've got my repositories locally > on my drive, not running any git servers though, so what now? Setting up a > local git server to access these repositories? That seems a bit overkill to > me. Setting up your own npm repository? Also feels like overkill. > > Thinking out loud: I just want to store these modules in a path, perhaps > say "npm install <destination-repo> and point to that path, control the > path via environment variables, perhaps similar to "maven" repositories as > used in the Java world. Multiple versions of the same package need to be > stored in the same structure. > > Thoughts anyone? > > > Antoine > > > On Mon, Jul 8, 2013 at 2:09 PM, Maxim Yefremov <[email protected]> wrote: > >> 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 site2 both >> use the same version of myLib >> >> -- >> -- >> 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 >> >> --- >> 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]. >> 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 [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 --- 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]. For more options, visit https://groups.google.com/groups/opt_out.
