.git file made it's way into release on NPM
"/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.
I can confirm this issue. Removing the .git directory fixes it.
Removing the .git directory fixes it.
Does the .git director show back up for you on subsequent npm installs?
I think it has started happening with 0.13.2. Never saw this since yesterday.
Can we get this sorted out asap?
Please take care of this.
+1
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
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.
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.
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
Please fix, this breaks our CI tests as well.
Same issue node_modules\react-native-safe-area-view: Appears to be a git repo or submodule.
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 ...
... seriously.
Thanks, @adam-buckley.
It's working for me.
Yarn works fine though
What's the status? Is this even being looked at?
Isn't rm -rf .git a bad practice?
@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?
@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.