How to update npm modules, ignoring a git repo

npm checks all directories for the existance of a .git directory, and throws the EISGIT error if it exists, so there is no way to ignore it or skip it.

The code does however check if it's a link:

mod.parent && !mod.isLink && [checkGit, mod.realpath],

So I was able to make it work by symlinking the module into node_modules.

$ ln -s ../some-module node_modules

I too had this issue whilst doing an npm install library and I was able to solve it by removing the .git directory (which is hidden inside node_modules/library_name) from the corresponding library_name mentioned in the error message.

Also make sure you don't delete the .git directory from the root of your project because if you delete the .git directory from the project root you will lose git related info like branch info,etc

Thanks to bolav for good a explanation regarding how the EISGIT error is thrown.

Tags:

Git

Npm