react-native-safe-area-view icon indicating copy to clipboard operation
react-native-safe-area-view copied to clipboard

.git file made it's way into release on NPM

Open Andrewsh86 opened this issue 7 years ago • 39 comments

"/path/to/my/project/node_modules/react-native-safe-area-view: Appears to be a git repo or submodule."

I'm getting this message whenever I try to run an NPM install.

It looks like a .git file made it into the release on NPM and is causing this issue.

If I delete the file, it shows back up on subsequent npm installs.

Andrewsh86 avatar May 10 '19 00:05 Andrewsh86

I can confirm this issue. Removing the .git directory fixes it.

bluefirepatrick avatar May 10 '19 01:05 bluefirepatrick

Removing the .git directory fixes it.

Does the .git director show back up for you on subsequent npm installs?

Andrewsh86 avatar May 10 '19 03:05 Andrewsh86

I think it has started happening with 0.13.2. Never saw this since yesterday.

yogeshchoudhary147 avatar May 10 '19 12:05 yogeshchoudhary147

Can we get this sorted out asap?

travisraghib avatar May 10 '19 21:05 travisraghib

Please take care of this.

dimgrav avatar May 11 '19 15:05 dimgrav

+1

pniedzwiedzinski avatar May 11 '19 22:05 pniedzwiedzinski

same issue here - I am trying to add typescript into my Expo project (following https://docs.expo.io/versions/latest/guides/typescript/) but I see this:

david@HPdk:~/it/XYZ$ npm install --save-dev typescript@^3.3.0 @types/expo@^32.0.0 @types/react-native@^0.57.0
npm WARN deprecated [email protected]: core-js@<2.6.5 is no longer maintained. Please, upgrade to core-js@3 or at least to actual version of core-js@2.
npm WARN enoent ENOENT: no such file or directory, open '/home/david/it/XYZ/node_modules/metro/node_modules/sane/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/home/david/it/XYZ/node_modules/metro-core/node_modules/sane/package.json'

npm ERR! path /home/david/it/XYZ/node_modules/react-native-safe-area-view
npm ERR! code EISGIT
npm ERR! git /home/david/it/XYZ/node_modules/react-native-safe-area-view: Appears to be a git repo or submodule.
npm ERR! git     /home/david/it/XYZ/node_modules/react-native-safe-area-view
npm ERR! git Refusing to remove it. Update manually,
npm ERR! git or move it out of the way first.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/david/.npm/_logs/2019-05-12T18_17_46_775Z-debug.log

rm -rf .git inside /node_modules/react-native-safe-area-view$ helped to solve this and installation passes...

similar approach was mentioned here https://github.com/APSL/react-native-version-number/issues/13

dkocich avatar May 12 '19 18:05 dkocich

In our experience, after removing .git subsequent installs did not bring it back. So, the workaround is not too bad once you recognize the problem.

jgfoster avatar May 13 '19 00:05 jgfoster

I was having it show back up after removal both during an npm install and npm audit.

Not sure why it would be different.

In any case, it should be fixed as soon as possible.

Andrewsh86 avatar May 13 '19 04:05 Andrewsh86

Any update on this? (I came to this repo because I updated react-navigation so this is probably affecting a lot of people)

The workaround of removing the .git folder works but it's pretty nasty to have to do it for preventing this error.

By the way this is the command I used for fixing it: rm -rf node_modules/@react-navigation/native/node_modules/react-native-safe-area-view/.git

fluiddot avatar May 13 '19 16:05 fluiddot

Please fix, this breaks our CI tests as well.

tdipadova3rd avatar May 13 '19 20:05 tdipadova3rd

Same issue node_modules\react-native-safe-area-view: Appears to be a git repo or submodule.

stevenbdf avatar May 13 '19 21:05 stevenbdf

It's frustrating when I'm trying to upgrade react and for debugging purposes am constantly removing node_modules and reinstalling, then getting this error, so I made a little script that might help someone else (using linux - should work on mac):

Put this in your project folder, call it whatever (mine was "fix-safe-view.sh")

#!/bin/bash

rm -rf ./node_modules/@react-navigation/native/node_modules/react-native-safe-area-view/.git
rm -rf ./node_modules/react-native-safe-area-view/.git

Then run chmod +x ./fix-safe-view.sh, then invoke it like ./fix-safe-view.sh && npm install ...

adam-buckley avatar May 14 '19 03:05 adam-buckley

... seriously.

SirCameron avatar May 14 '19 10:05 SirCameron

Thanks, @adam-buckley.

It's working for me.

MaheshNandam avatar May 14 '19 17:05 MaheshNandam

Yarn works fine though

AyushG3112 avatar May 14 '19 17:05 AyushG3112

What's the status? Is this even being looked at?

caclowers avatar May 14 '19 19:05 caclowers

Isn't rm -rf .git a bad practice?

movaldivia avatar May 14 '19 21:05 movaldivia

@fluiddot Think it's worth creating an issue on the react-navigation repo too, since I imagine many people ran into this issue because this is a dep of that package?

pcowgill avatar May 14 '19 22:05 pcowgill

@movaldivia I'm not 100% sure if it is or isn't in the context of NPM, but it's obvious it shouldn't be there since this issue breaks interactions with NPM. I'm guessing the standard practice is to not publish an NPM package with the .git folder included.

adam-buckley avatar May 14 '19 23:05 adam-buckley