Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

react-native-push-notification Appears to be a git repo or submodule. #1057

Closed
behnamshateri opened this issue Apr 26, 2019 · 23 comments
Closed

Comments

@behnamshateri
Copy link

i have install react-native-push-notification and react-native link react-native-push-notification
but when i want to install another package or run npm install i face with this error

node_modules\react-native-push-notification: Appears to be a git repo or submodule.
@WhippetsAintDogs
Copy link

Same here, I need to delete the package from my node_modules folder on the preinstall hook in order to make npm install work

@danielsotopino
Copy link

Deleting the .git folder on react-native-push-notification and npm install afterwards makes it work.

@tmaly1980
Copy link

Yes, but why does this happen in the first place?

@jeveloper
Copy link

This is something new with npm 6.9 i think

@shreyasb07
Copy link

remove any .git files present in the node_modules folder

In your terminal, from your project folder:
rm -rf node_modules/*/.git

@infiniteline
Copy link

Yeah. This was definitely bothering me as well. I agree that it seems like it shouldn't be happening in the first place?

@mcrowe
Copy link

mcrowe commented May 17, 2019

@zo0r This is a bug in this package. The ".git" directly should not be included in the npm package.

@jdegger
Copy link

jdegger commented May 21, 2019

@zo0r is this going to be fixed anytime soon? I'm getting tired of not being able to do npm install with ease

@danielsotopino
Copy link

I believe this is a problem with NPM (npm/npm#20213)

@mlazari
Copy link

mlazari commented May 22, 2019

This only happens in latest version, 3.1.3. As a temporary workaround we use 3.1.2 for now, which seems to not have this problem.

@davidcorbin
Copy link

Would love to see a fix for this! @zo0r Please update the npm package 😆

@jdegger
Copy link

jdegger commented Jun 3, 2019

As a temporary fix we added the following to our scripts section of package.json:

    "preinstall": "rm -Rf ./node_modules/react-native-push-notification;"

This will probably not work on Windows but a similar solution on Windows can be applied.

@SergeyIsakhanyan
Copy link

SergeyIsakhanyan commented Jun 4, 2019

@mlazari I have the same problem with 3.1.2 version.
rm -rf node_modules/*/.git worked for me.

@mlazari
Copy link

mlazari commented Jun 4, 2019

@SergeyIsakhanyan Did you remove node_modules folder before downgrading to 3.1.2?

@isaiahols
Copy link
Contributor

The issue is that .git was not ignored by putting it in your .npmignore.
I've made a PR to fix this! @zo0r Please merge

#1085

@mlazari
Copy link

mlazari commented Jun 13, 2019

@isaiahols I'm looking at other dependencies we use that don't have this issue and they also don't have .git in their .npmignore files:

react-native doesn't even seem to have a .npmignore file as far as I can tell.

That could solve the issue, but it's probably not the only issue. 3.1.3 was probably published with a problematic npm version that has the issue pointed above.

@isaiahols
Copy link
Contributor

@mlazari you are absolutely correct this is an not issue. The issue is that the npmignore is supposed to include the . git by default but it is not. So the current working solution while that is being sorted is to just include it manually. Then when the fix is up there is still no issue with including it in your npmignore as it is there by default.

Just something to help in the meantime as this only seems to effect a few dependencies, this one included.

@tberghuis
Copy link

Is there a valid reason for having a .git folder in the node_modules dir?

@drash-course
Copy link

Is there a valid reason for having a .git folder in the node_modules dir?

No. You should never have anything under version control down there because changes you make will never be saved between installs.

@jack-douglas
Copy link

This PR will fix this issue. https://github.com/zo0r/react-native-push-notification/pull/1085

@zo0r zo0r closed this as completed in c09b494 Jul 7, 2019
@nileshpandey3
Copy link

remove any .git files present in the node_modules folder

In your terminal, from your project folder:
rm -rf node_modules/*/.git

This helped me.Thanks

@Rotemy
Copy link

Rotemy commented Sep 12, 2019

rm -rf node_modules/*/.git

Worked!

@schumannd
Copy link
Contributor

Any update on this? Still happening half a year later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests