title: Using gulp for builds without npm install
body: <p>I'm working in a web application (JavaScript/C#, version controlled by TFS) and our team wants to start using Visual Studio 2015. Microsoft is moving developers to use existing popular tools like Gulp for automated tasks, so I've written a few Gulp tasks that will run on the server.</p>
  
  <p>My problem is that our automated builds generate new project folders on the build server, so I can't run <code>gulp myBuildTask</code> without first running <code>npm install</code>. The npm install adds over 2 minutes to the build process, and it seems very inefficient to download the same dependencies for every build (since they will change rarely).</p>
  
  <p>Is there anyway I can run a Gulp task on a new project folder without first running <code>npm install</code>?</p>
  
  <p>Options I've considered:</p>
  
  <ol>
  <li><p><strong>Include node_modules in TFS.</strong> I couldn't add the node_modules folder to TFS (which would cause it to exist in each new build folder) because bower's nested dependencies have file paths that are too long for Windows. I could go this route without bower, but I'm not certain I want all those files in my solution (much of which is not needed, like readme's and test files).</p></li>
  <li><p><strong>Run</strong> <code>npm install</code> <strong>after each automated build.</strong>
  As already mentioned, I don't want to do this because it adds several minutes to the build process. </p></li>
  <li><p><strong>Install NPM modules globally.</strong>
  I'm not sure if this is even possible, but I'm wondering if I can install all project dependencies globally on the build server (avoiding having to install at the project level). My concern with an approach like this is that I don't want to have to manually update the build server's globally installed NPM modules every time we add a gulp plugin.</p></li>
  </ol>
  
  <p>Ideally, the solution would be something like #3. The modules would install globally, but every build could run an <code>npm install</code> which would verify every module is installed. If a new npm module was added to the package.json, it would be downloaded. This <code>npm install</code> would be pretty fast since in most cases, all modules would already exist (globally installed on the build server).</p>