How to update npm modules, ignoring a git repo

I forked one of npm modules and now it is a git repo.

So my package.json:

  • Force Git submodules to always stay current
  • Git error when trying to commit from Visual Studio 2015 ( file opensdf)
  • Bitbucket branch management
  • Is there a better way to use git update-index --skip-worktree while also making changes to the same file?
  • Jar Dependencies in GitHub
  • git update-index --no-assume-unchanged doesn't work
  • "dependencies": {
        "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?

  • What's the best practice for handling system-specific information under version control?
  • Copy 1 commit from one branch (dev) to another (stable) with clean working dir
  • Git - working on wrong branch - how to copy changes to existing topic branch
  • Renamed files inside git
  • git-diff to ignore ^M
  • Updating a git mirror of an SVN repository
  • 2 Solutions collect form web for “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

    Yes, there’s a way to skip the error.

    1) Open the file “C:\Program Files\nodejs\node_modules\npm\node_modules\npm-install-checks\index.js”
    2) Comment out this code at the very bottom:

    if (!er && s.isDirectory()) {
      var e = new Error(folder + ': Appears to be a git repo or submodule.')
      e.path = folder
      e.code = 'EISGIT'
      return cb(e)



    From another dev long frustrated by this error; none of the suggested solutions work in my case because of constraints from various systems.

    Suggestion: NPM works with symlinks, so create symlink of module from node_modules, to your library repo folder.
    Problem: Then Watchman doesn’t scan the JS files within.

    Suggestion: Do “npm publish” and “npm install”. Every. Single. Time.
    Problem: Terrible for quick development tests/cycles, and spams the npm directory with hundreds of never-to-be-used versions.

    Suggestion: Use Watchman Links (WML). (i.e. directory auto-copying on file-change)
    Problem: Have to have a background program running all the time, for all the included repos on my machine. Also, it means I can’t open the files directly in the node_modules folder to make quick changes; instead I have to go to the library’s source repo every time. That’s fine usually, but sometimes it’s nice to make changes in the program repo, and have it reflected in the library repo, in addition to vice-versa.

    My solution

    So yeah, with the above change, I can use a hard-link clone of the library directory and avoid the problems above.

    I use this to create the directory-level hard-link clone:

    The one problem with this approach is that I have to re-run the hard-link clone whenever I add or remove files in the library. But at least I don’t have to do anything when changes are made within existing files. (which is by far more painful)

    Git Baby is a git and github fan, let's start git clone.