I am using the yeoman nuget package in a visual studio .NET MVC project to generate an angularJS front end. After installing yeoman and generating an app, I get this error trying to commit to git:
An error occurred. Detailed message: An error was raised by libgit2. Category = Invalid (Error). Failed to open directory 'C:/my/project/node_modules/super/long/directory'
This is happening because of the dreaded Windows 256 character limit on file/directory names. How do I fix this so I can commit to git?
I don't love this answer, but it works. The long paths were for 2 specific grunt node modules that I did not need. Specifically
grunt-contrib-imagemin
andgrunt-google-cdn
. So here's what I did:cdnify
andimagemin
from theGruntfile.js
to remove those tasks from the build.