DEV Community

Cover image for Fix build fail when you have git repo or submodule on your npm packages
Hamed
Hamed

Posted on

Fix build fail when you have git repo or submodule on your npm packages

I use GitLab CI/CD and GitLab Runner for builds. Today, one of my Vuejs projects suddenly started to fail builds. When I read logs I found out that one of the dependencies in node_modules contains the git folder.

The quick fix for situations like these is to delete the git folder from your npm package folder. Here is the command you can add to your build script for Linux

rm -rf node_modules/*/.git/

and if you are on windows you can add the following command:

Remove-Item -Recurse -Confirm:$false node_modules/*/.git/

Top comments (0)