shama / napa

:wine_glass: A helper for installing stuff without a package.json with npm.
MIT License
413 stars 34 forks source link

"Appears to be a git repo or submodule" error w/ npm 3 #53

Closed caseyWebb closed 9 years ago

caseyWebb commented 9 years ago
npm ERR! Darwin 15.0.0
npm ERR! argv "/usr/local/bin/iojs" "/Users/casey/.npm/bin/npm" "install"
npm ERR! node v4.1.0
npm ERR! npm  v3.2.1
npm ERR! path /Users/casey/Code/UniversitySite/node_modules/flippant
npm ERR! code EISGIT

npm ERR! git Appears to be a git repo or submodule.
npm ERR! git     /Users/casey/Code/UniversitySite/node_modules/flippant
npm ERR! git Refusing to remove it. Update manually,
npm ERR! git or move it out of the way first.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/casey/Code/UniversitySite/npm-debug.log

and relevant package.json section

"napa": {
  "flippant": "mintchaos/flippant.js",
}
caseyWebb commented 9 years ago

My current workaround modifying the install script in package.json to napa && rm -rf node_modules/*/.git/

shama commented 9 years ago

Ah interesting. Yeah that would be good to fix. Thanks for reporting!

caseyWebb commented 9 years ago

I can probably take care of this.

caseyWebb commented 9 years ago

:sunglasses: :+1:

shama commented 9 years ago

Fixed on dcfa42d

Anahkiasen commented 8 years ago

Still happening in 2.0.1 as far as I can tell:

"scripts": {
    "install": "napa"
  },
  "napa": {
    "js-marker-cluster": "googlemaps/js-marker-clusterer"
  }
$ ls -al node_modules/js-marker-cluster
total 584
drwxr-xr-x   14 anahkiasen  staff     476 Oct 13 11:31 .
drwxr-xr-x  894 anahkiasen  staff   30396 Oct 13 11:31 ..
drwxr-xr-x   13 anahkiasen  staff     442 Oct 13 11:31 .git
-rw-r--r--    1 anahkiasen  staff     322 Oct 13 11:31 AUTHORS
-rw-r--r--    1 anahkiasen  staff    1184 Oct 13 11:31 CONTRIBUTING.md
-rw-r--r--    1 anahkiasen  staff     505 Oct 13 11:31 CONTRIBUTORS
-rw-r--r--    1 anahkiasen  staff   11324 Oct 13 11:31 LICENSE
-rw-r--r--    1 anahkiasen  staff    1473 Oct 13 11:31 README.md
-rw-r--r--    1 anahkiasen  staff     505 Oct 13 11:31 bower.json
drwxr-xr-x    4 anahkiasen  staff     136 Oct 13 11:31 docs
drwxr-xr-x    7 anahkiasen  staff     238 Oct 13 11:31 examples
drwxr-xr-x   16 anahkiasen  staff     544 Oct 13 11:31 images
-rw-r--r--    1 anahkiasen  staff  263841 Oct 13 11:31 screenshot.png
drwxr-xr-x    4 anahkiasen  staff     136 Oct 13 11:31 src

$ npm install scriptjs --save
npm ERR! Darwin 15.0.0
npm ERR! argv "/Users/anahkiasen/.nvm/versions/node/v4.1.2/bin/node" "/Users/anahkiasen/.nvm/versions/node/v4.1.2/bin/npm" "install" "scriptjs" "--save"
npm ERR! node v4.1.2
npm ERR! npm  v3.3.7
npm ERR! path /Users/anahkiasen/Sites/madewithlove/weholi/node_modules/js-marker-cluster
npm ERR! code EISGIT

npm ERR! git Appears to be a git repo or submodule.
npm ERR! git     /Users/anahkiasen/Sites/madewithlove/weholi/node_modules/js-marker-cluster
npm ERR! git Refusing to remove it. Update manually,
npm ERR! git or move it out of the way first.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/anahkiasen/Sites/madewithlove/weholi/npm-debug.log
caseyWebb commented 8 years ago

@shama I have pushed a fix to master, I need to bump version and publish to npm (if you trust me)

@Anahkiasen this will be published shortly, in the meantime if this is blocking, you can install napa via shama/napa in your package.json. This will just install from master's HEAD commit.

shama commented 8 years ago

@caseyWebb Yep! I've added you as an owner (at least I hope it is you on npm, https://www.npmjs.com/~caseywebb). I consider any significant contributor to any project I've started to have the same level of ownership as myself. So feel free to make and publish any changes you see fit. I really appreciate your help!

I use this script: https://www.npmjs.com/package/npm-release to publish releases as it will commit, tag and publish in one swoop. But I know there is plenty of other tooling. Feel free to use whatever suits you best.

Lucciniolo commented 8 years ago

Hello,

The same now :

npm ERR! Linux 3.16.0-4-amd64
npm ERR! argv "/home/*/.nvm/versions/node/v6.7.0/bin/node" "/home/*/.nvm/versions/node/v6.7.0/bin/npm" "install"
npm ERR! node v6.7.0
npm ERR! npm  v3.10.3
npm ERR! path /home/*/*/node_modules/jquery-slimscroll
npm ERR! code EISGIT

npm ERR! git /home/*/*/node_modules/jquery-slimscroll: Appears to be a git repo or submodule.
npm ERR! git     /home/*/*/node_modules/jquery-slimscroll
npm ERR! git Refusing to remove it. Update manually,
npm ERR! git or move it out of the way first.

best regards,

justin808 commented 7 years ago

I'm also seeing this. What's the workaround?

iSkore commented 6 years ago

Just for reference - I had this issue when publishing my module.

Refer to NPM "files" It's a safer & less tedious way than using .npmignore

nullivex commented 5 years ago

For reference after I searched around for this a while the do the following to fix this issue.

1) Run npm pack check the logs and see if anything is being packed from .git 2) For me it was .git/index im not exactly sure the cause but adding .git to the .gitignore fixed this for me. I believe this is safe since Git will ignore that entry.