-1

I am trying to use React Native Navigation 5. I have added all the dependency but when i am adding

npm install react-native-gesture-handler it is giving the below error:

npm ERR! code ENOENT      
npm ERR! syscall spawn git
npm ERR! path git
npm ERR! errno ENOENT
npm ERR! enoent Error while executing:
npm ERR! enoent undefined ls-remote -h -t https://github.com/naver/hammer.js.git
npm ERR! enoent 
npm ERR! enoent 
npm ERR! enoent spawn git ENOENT
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

Then i followed the below solution and downloaded the Github, save the path in System Variable but it did not work. Please suggest what wrong i am doing.

https://stackoverflow.com/a/23179102

My package.json

{
  "name": "NavigationExample",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "android": "react-native run-android",
    "ios": "react-native run-ios",
    "start": "react-native start",
    "test": "jest",
    "lint": "eslint ."
  },
  "dependencies": {
    "@egjs/hammerjs": "^2.0.17",
    "@react-native-community/masked-view": "^0.1.6",
    "@react-navigation/native": "^5.0.1",
    "@react-navigation/stack": "^5.0.1",
    "react": "16.9.0",
    "react-native": "0.61.5",
    "react-native-reanimated": "^1.7.0",
    "react-native-safe-area-context": "^0.7.2",
    "react-native-screens": "^2.0.0-beta.2"
  },
  "devDependencies": {
    "@babel/core": "7.8.4",
    "@babel/runtime": "7.8.4",
    "@react-native-community/eslint-config": "0.0.5",
    "babel-jest": "24.9.0",
    "eslint": "6.8.0",
    "jest": "24.9.0",
    "metro-react-native-babel-preset": "0.56.4",
    "react-test-renderer": "16.9.0"
  },
  "jest": {
    "preset": "react-native"
  }
}

It is working fine on mac but not working on Windows 10 Home.

Däñish Shärmà
  • 2,891
  • 2
  • 25
  • 43

3 Answers3

2

This link helped me to get out of this issue: Here's a link

In short Download Git then follow the below steps:

  • Open Environment Variables
  • Edit Path
  • Find your git location that been installed in your device. Example like mine is C:\Program Files\Git\cmd
  • Add the git location to Path (make sure to add this to both user variables and system variables)
  • Apply the changes and restart your pc
  • Lastly, go back to your project and run npm install react-native-gesture-handler
Usama
  • 77
  • 11
0

This looks like a permission error. Please run your command line as a Administrator.

0

delete your node module and try again

npm install
Shivo'ham 0
  • 1,333
  • 11
  • 19