I forked one of npm modules and now it is a git repo.
So my package.json:
"dependencies": { "some-module": "git+https://github.com/my-name/some-module.git", }
Forked repo is synchronized by fetching upstream and merging. But when I try to update other npm modules it gives error:
npm ERR! git Appears to be a git repo or submodule. npm ERR! git /Users/.../node_modules/some-module npm ERR! git Refusing to remove it. Update manually, npm ERR! git or move it out of the way first. npm ERR! System Darwin 13.4.0 npm ERR! command "node" "/usr/local/bin/npm" "update" npm ERR! cwd /Users/... npm ERR! node -v v0.10.32 npm ERR! npm -v 1.4.28 npm ERR! path /Users/.../node_modules/some-module npm ERR! code EISGIT npm ERR! npm ERR! Additional logging details can be found in: npm ERR! /Users/.../npm-debug.log npm ERR! not ok code 0
Is there any way to ignore git repo when updating? Or to skip this error?
You should not include folder node_modules in your . gitignore file (or rather you should include folder node_modules in your source deployed to Heroku). If folder node_modules: exists then npm install will use those vendored libraries and will rebuild any binary dependencies with npm rebuild .
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With