I am working on a node.js based website with multiple developers. I followed the advice from here and here and checked in all the node_modules to git.
Each of the developers are using a Macbook Pro for development.
I've noticed there are problems with node_modules when another developer clones or pulls from the git repo. When they try to run the dev server (via gulp) they will get errors like:
module.js:340
throw err;
^
"Error: Cannot find module ..."
They can look in their node_modules folder and find the module, but gulp cannot find it. If they uninstall that particular module and reinstall it, it will work but they then get the same error for another module. If they delete their node_modules folder and then run 'npm install', everything will work again. However, if they check in their code and I later pull their changes down, then I start seeing the same errors they were seeing.
Since we are all using virtually the same computers and probably close or the same versions of node, I'm not sure why this would happen. Why would npm/gulp no longer detect modules after a git pull?
Should I just give up and remove the node_modules from the repo?