On Monday, October 7, 2013 11:42:32 AM UTC-7, Luke Arduini wrote: > Hi David, > > Yes, that's basically the main use for a package.json. If you put it in a > directory and run `npm install`, it will install the dependencies > specified. For projects where you want to lock down dependencies & their > dependencies, look into using shrinkwrap: > > https://npmjs.org/doc/shrinkwrap.html >
For what I'm doing with this so far, I'm attempting to always use global scope, so I assume that would be "npm install -g". I ran "npm shrinkwrap", and that somewhat understandably failed big time, as I didn't have a local node_modules, so it didn't find any of the packages specified in the local "packages.json" installed. So, I then ran "npm shrinkwrap -g". That said only this: "wrote npm-shrinkwrap.json". That was interesting, because there was no resulting "npm-shrinkwrap.json" file in the current directory. I finally found it in <global>/node_modules/npm/test/packages/npm-test-shrinkwrap/npm-shrinkwrap.json (where "global" is where I installed nodejs). However, I looked at this file, and it didn't list any of my required packages, so I'm confused. > > > On Mon, Oct 7, 2013 at 11:32 AM, David Karr > <[email protected]<javascript:> > > wrote: > >> I've prototyped a javascript unit testing infrastructure using Karma >> under npm. I created a package.json file, but I don't understand what I'm >> supposed to do with this file. I've seen lots of documentation on how to >> create this, but the explanations of what it's used for seem to be >> incomplete. >> >> What I would HOPE I can do with it is store it in source control for my >> project, and when I set up this build on another host, it will somehow read >> the package.json file and install the expected versions of all the packages >> I'm using. Is this a common and reasonable thing to do? If so, how do I >> make this happen? >> >> -- >> -- >> 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]<javascript:> >> To unsubscribe from this group, send email to >> [email protected] <javascript:> >> 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] <javascript:>. >> 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.
