1

We are using visual studio 2015 and TFS 2013. We created a Cordova javascript project and added it to source control. When we add dependencies to the package.json file they are downloaded in to the node_modules folder. The node_modules folder was not checked in when the solution was initially added to source control. Once the packages are restored on a developer machine, the node_modules folder is added to the Pending Changes tab and the files are locked by the last dev machine which restored packages. I would like to exclude the node_modules folder from TFS completely, as it is restored on each developer machine. We are using server workspaces, so .tfignore files have no effect. Adding a check in policy only shows a warning, which is overridable, if a developer is not paying attention and is also a bad user experience IMHO.

Is there an alternative?

Elad Lachmi
  • 10,406
  • 13
  • 71
  • 133
  • Just as you said, .tfignore file doesn't work as you work with server workspace. You need to choose to use check-in policy. For your concern about check-in policy overridden, how about you set up an alert so that managers will get email notifications when one policy is overridden. After the TFS2013 power tool is installed, choose to use "Check-In to specific folder with policy overridden" alert. – Vicky - MSFT Aug 18 '15 at 08:29
  • @Vicky - Thanks for your input. The problem is that once they are checked in and checked out by someone during a routine build, they are locked for other developers. I don't want to be running around undoing peoples checkins all day. I am looking for a better solution. – Elad Lachmi Aug 18 '15 at 09:41
  • I would recommend not using server workspaces, and definitely not using exclusive check-out. – Daniel Mann Aug 18 '15 at 12:48
  • @DanielMann - Exclusive checkout and get latest on checkout are essential to how our team collaborates. On the other hand, offline operations are irrelevant for our work environment. Why is this not recommended, a side from all the cool kids doing it? – Elad Lachmi Aug 18 '15 at 12:53
  • @EladLachmi, please help me to understand (I'm not familiar with cordova project): is the node_modules folder is a folder in the solution? I checked and found that node_modules folder is:%AppData%\npm\node_modules . So what is the opportunity to have node_modules folder added to version control? – Vicky - MSFT Aug 19 '15 at 02:25
  • @Vicky - What you are seeing is the global `node_modules`. A project can also have a local `node_modules` folder. Think of it as having an assembly in the `GAC` vs, local `bin` folder. – Elad Lachmi Aug 19 '15 at 04:47
  • This question has been answered [here](http://stackoverflow.com/a/1939201/4775223) – Wilmer SH Feb 25 '16 at 17:38

0 Answers0