Error: Unable to resolve module "react-native-gesture-handler"

Dung Do Tien Jan 21 2021 112

In React native  I want to make navigation and I install react-navigation package by npm install --save react-navigation command but I got error unable to resolve "react-native-gesture-handler" from "node_modules/@react-navigation/native/src/Scrollables.js".

below is my package.json

 {
  "name": "ProjectName",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "node node_modules/react-native/local-cli/cli.js start",
    "test": "jest"
  },
  "dependencies": {
    "react": "16.8.3",
    "react-native": "0.59.1",
    "react-native-sqlite-storage": "^3.3.10",
    "react-navigation": "^3.5.1"
  },
  "devDependencies": {
    "@babel/core": "7.4.0",
    "@babel/runtime": "7.4.2",
    "babel-jest": "24.5.0",
    "eslint-config-rallycoding": "^3.2.0",
    "jest": "24.5.0",
    "metro-react-native-babel-preset": "0.53.1",
    "react-test-renderer": "16.8.3"
  },
  "jest": {
    "preset": "react-native"
  }
}

Thanks for any suggesstion.

Have 2 answer(s) found.
  • To resolve this issue, you need to install react-native-gesture-handler package:

     yarn add react-native-gesture-handler

    OR if you use npm

     npm install react-native-gesture-handler

    And the link the library in the specific project

     react-native link react-native-gesture-handler

    I hope it's helpful for you.

    Le Ba Tuan Anh Jan 21 2021
  • I got the same issue. Solved it by:

     npm uninstall react-native-gesture-handler --save 

    And then

     npm install react-native-gesture-handler --save 
    Mary Christ Jan 21 2021
Leave An Answer
* NOTE: You need Login before leave an answer

* Type maximum 2000 characters.

* All comments have to wait approved before display.

* Please polite comment and respect questions and answers of others.

Popular Tips

X Close