node.js - portable accross two machines?

I have a complex node/express app that runs fine locally and on server. When we clone the project on another laptop, we are getting the http.js header error:

http.js:689
throw new Error('Can\'t set headers after they are sent.');

I've been through all the answers here and been through the code line by line - the only thing I've found is that calls to the 'req' object in node seem to cause the error to happen:

console.log(req.params.docId); //(causes error - docId is undefined in this case)

for route:

app.get('/:user/:docId', homeController.index);

Again, the code runs fine on one laptop and one server but not on 2nd laptop. Is this a dependency issue? We've tried manually copying all node_modules. How can we fix this?

node v0.10.28, running with nodemon v1.2.1

Thanks very much.

thanks @reydellon it looks like we had a loose next() in our code and for whatever reason it never errored on us before.

I guess this error is always a code issue.. check out the resource posted above for more