How to commit NPM module Names to git without the actual files so that they can get rebuilt at the other end?

I'm developing a node project which depends on several npm modules. What I'm currently doing is committing all those modules to my git repository, pulling on my server, and then rebuilding the modules on the other end because the system architectures are different. What I would like to do instead, is just commit enough stuff so that npm knows what it needs to rebuild, and nothing more.

I would hoping I could do this without actually committing all the module files. I know little about npm's internals, but see that every module has a package.json file, is this all that npm will need? And if that's the case, how would I go about ignoring all files in my node_modules folder except the package.json files?

Thanks.

Why can't you just have a package.json file in your main application root listing all your dependencies? This file should then be the only thing checked in to source control.

At build time or when other developers pull the code, npm install should be run from the same directory that has your package.json file. It will then pull down all your dependencies locally.