We do not version node_modules for our deploying apps but we use shrinkwrap and packaging all deps in CI after running all tests using http://github.com/carlos8f/bundle-deps. This little cli utility move all dependencies to bundleDependencies.
The CI script is something along these lines: npm install npm test npm prune --production bundle-deps npm version patch $BUILD_NUMBER npm pack the result artifact is a npm pack with all dependencies inside. During deployment we use "npm install module.tgz" and yes this compile native dependencies. We never have problems with things compiled differently but it is something I would like to review in the future. I blame linux distributions for breaking binary compatibility, this make building everything ahead of time complicated. I don't like to version node_modules because: 1- messy commits with tons of file changes 2- if you clone the repo in other platform it will probabily not work because..... native dependencies and binary compatibility Right now we are in the process of replicating npm in a cloud vm (its almost finished). 2013/11/6 Will <[email protected]> > For the Googlers of the future that reach this thread: the answer depends > on the nature of your project. > > - *Do** track* `node_modules` in your repo if you are deploying an app. > - *Do not** track* `node_modules` in your repo if your project is a > reusable package meant to be consumed by other projects. > > See this post <http://www.futurealoof.com/posts/nodemodules-in-git.html>for > an explanation as to why this is the best practice. > > Also, it's a good idea to register *all* dependencies in your > `package.json`: a dependency can be any git repo, not only ones published > in the npm registry. > > On Sunday, December 4, 2011 3:56:52 PM UTC-5, deitch wrote: >> >> You are building an app, it has dependencies on lots of modules that >> you install via npm. But versionizing those in git seems redundant. >> What do people here do? Do they keep node_modules as tracked part of >> git? Or do they put it in .gitignore, and if so, then how do you know >> which versions and dependencies you have? >> > -- > -- > 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.
