Giter Club home page Giter Club logo

Comments (5)

alessandrocapra avatar alessandrocapra commented on June 8, 2024 1

Sorry for the delay, but eventually I upgraded to expo 48 and the error went away.

from jest-native.

mdjastrzebski avatar mdjastrzebski commented on June 8, 2024

@alessandrocapra Our peer dep of >= 16.0.0 should work fine with Expo 47 & React 18.1.0. Pls check our basic example app which uses these exact versions: https://github.com/callstack/react-native-testing-library/blob/main/examples/basic/package.json

from jest-native.

ADavisDon avatar ADavisDon commented on June 8, 2024

I have also encountered the dependency error, but only when attempting to build our Expo app.

package.json

{
  "engines": {
    "npm": ">=8.11.0",
    "node": "v16.16.0"
  },
  "main": "node_modules/expo/AppEntry.js",
  "scripts": {
    "start": "expo start",
    "offline": "expo start --offline",
    "android": "expo start --android",
    "ios": "expo start --ios",
    "web": "expo start --web",
    "eject": "expo eject",
    "lint": "eslint . --fix",
    "test": "jest"
  },
  "dependencies": {
    "@expo/vector-icons": "^13.0.0",
    "@react-native-async-storage/async-storage": "~1.17.3",
    "@react-native-community/cli-server-api": "^8.0.0",
    "@react-navigation/bottom-tabs": "~6.3.1",
    "@react-navigation/drawer": "^6.4.1",
    "@react-navigation/elements": "1.3.3",
    "@react-navigation/material-bottom-tabs": "6.2.1",
    "@react-navigation/material-top-tabs": "6.2.1",
    "@react-navigation/native": "6.0.10",
    "@react-navigation/native-stack": "6.6.1",
    "@react-navigation/stack": "6.2.1",
    "@redux-devtools/extension": "^3.2.2",
    "@reduxjs/toolkit": "^1.8.3",
    "@rneui/base": "^4.0.0-rc.6",
    "@rneui/themed": "^4.0.0-rc.6",
    "axios": "^0.27.2",
    "expo": "^46.0.0",
    "expo-barcode-scanner": "~11.4.0",
    "expo-build-properties": "~0.3.0",
    "expo-checkbox": "~2.2.0",
    "expo-constants": "~13.2.4",
    "expo-device": "~4.3.0",
    "expo-firebase-analytics": "~7.2.0",
    "expo-image-picker": "~13.3.1",
    "expo-linking": "~3.2.4",
    "expo-splash-screen": "~0.16.2",
    "expo-updates": "~0.14.6",
    "expo-web-browser": "~11.0.0",
    "install": "^0.13.0",
    "lodash": "^4.17.21",
    "react": "18.0.0",
    "react-devtools": "^4.25.0",
    "react-hook-form": "^7.42.1",
    "react-native": "0.69.6",
    "react-native-animatable": "^1.3.3",
    "react-native-dotenv": "^3.3.1",
    "react-native-elements": "^3.4.2",
    "react-native-gesture-handler": "~2.5.0",
    "react-native-gifted-chat": "1.0.3",
    "react-native-maps": "0.31.1",
    "react-native-pager-view": "5.4.24",
    "react-native-paper": "^4.7.2",
    "react-native-reanimated": "~2.9.1",
    "react-native-redux": "^1.0.11",
    "react-native-render-html": "^6.3.4",
    "react-native-safe-area-context": "4.3.1",
    "react-native-screens": "~3.15.0",
    "react-native-section-alphabet-list": "2.1.0",
    "react-native-snap-carousel": "^1.3.1",
    "react-native-svg": "12.3.0",
    "react-native-tab-view": "^3.0.0",
    "react-native-vector-icons": "^9.2.0",
    "react-native-webview": "11.23.0",
    "react-navigation-header-buttons": "^6.3.1",
    "react-qr-code": "^2.0.11",
    "react-redux": "^8.0.2",
    "redux": "^4.2.0",
    "redux-persist": "6.0.0",
    "redux-saga": "1.1.3",
    "rn-keyboard-sticky-view": "^1.0.4",
    "yargs": "^17.6.2"
  },
  "devDependencies": {
    "@babel/core": "^7.18.6",
    "@gorhom/bottom-sheet": "^4.4.5",
    "@react-native-community/cli-debugger-ui": "8.0.0",
    "@testing-library/jest-native": "^5.4.0",
    "@testing-library/react-native": "^11.0.0",
    "@types/react": "~18.0.24",
    "@types/react-native": "~0.70.6",
    "babel-eslint": "^10.1.0",
    "babel-preset-expo": "~9.2.0",
    "eslint": "^8.20.0",
    "eslint-config-airbnb": "^19.0.4",
    "eslint-config-standard": "^17.0.0",
    "eslint-plugin-import": "^2.26.0",
    "eslint-plugin-jsx-a11y": "^6.6.1",
    "eslint-plugin-n": "^15.2.4",
    "eslint-plugin-promise": "^6.0.0",
    "eslint-plugin-react": "^7.31.10",
    "jest": "^28",
    "jest-expo": "^48.0.2",
    "metro-react-native-babel-preset": "^0.59.0",
    "react-native-section-list-get-item-layout": "^2.2.3",
    "react-test-renderer": "^18.2.0",
    "web-vitals": "^2.1.4"
  },
  "overrides": {
    "react-native": {
      "react-devtools-core": "4.25.0"
    }
  },
  "jest": {
    "preset": "jest-expo",
    "transformIgnorePatterns": [
      "node_modules/(?!((jest-)?react-native|@react-native(-community)?)|expo(nent)?|@expo(nent)?/.*|@expo-google-fonts/.*|react-navigation|@react-navigation/.*|@unimodules/.*|unimodules|sentry-expo|native-base|react-native-svg|@testing-library)"
    ],
    "setupFilesAfterEnv": [
      "<rootDir>/jestSetupFile.js",
      "@testing-library/jest-native/extend-expect"
    ],
    "collectCoverage": true,
    "collectCoverageFrom": [
      "**/*.{js,jsx}",
      "!**/coverage/**",
      "!**/node_modules/**",
      "!**/babel.config.js",
      "!**/jest.setup.js"
    ]
  },
  "private": true
}

Errors

[INSTALL_DEPENDENCIES] Running "npm install" in the root dir of your repository
[INSTALL_DEPENDENCIES] npm ERR!
[INSTALL_DEPENDENCIES] code ERESOLVE
[INSTALL_DEPENDENCIES] npm ERR!
[INSTALL_DEPENDENCIES] ERESOLVE could not resolve
[INSTALL_DEPENDENCIES] npm ERR!
[INSTALL_DEPENDENCIES] npm ERR! While resolving: [email protected]
[INSTALL_DEPENDENCIES] npm ERR! Found: [email protected]
[INSTALL_DEPENDENCIES] npm ERR! node_modules/react
[INSTALL_DEPENDENCIES] npm ERR!   react@"18.0.0" from the root project
[INSTALL_DEPENDENCIES] npm ERR!   peer react@">=16.3.0" from @callstack/[email protected]
[INSTALL_DEPENDENCIES] npm ERR!   node_modules/@callstack/react-theme-provider
[INSTALL_DEPENDENCIES] npm ERR!     @callstack/react-theme-provider@"^3.0.7" from [email protected]
[INSTALL_DEPENDENCIES] npm ERR!     node_modules/react-native-paper
[INSTALL_DEPENDENCIES] npm ERR!       react-native-paper@"^4.7.2" from the root project
[INSTALL_DEPENDENCIES] npm ERR!       1 more (@react-navigation/material-bottom-tabs)
[INSTALL_DEPENDENCIES] npm ERR!   44 more (@expo/react-native-action-sheet, ...)
[INSTALL_DEPENDENCIES] npm ERR!
[INSTALL_DEPENDENCIES] npm ERR! Could not resolve dependency:
[INSTALL_DEPENDENCIES] npm ERR! peer react@"^18.2.0" from [email protected]
[INSTALL_DEPENDENCIES] npm ERR! node_modules/react-test-renderer
[INSTALL_DEPENDENCIES] npm ERR!   dev react-test-renderer@"^18.2.0" from the root project
[INSTALL_DEPENDENCIES] npm ERR!   peer react-test-renderer@">=16.0.0" from @testing-library/[email protected]
[INSTALL_DEPENDENCIES] npm
[INSTALL_DEPENDENCIES] ERR!   node_modules/@testing-library/jest-native
[INSTALL_DEPENDENCIES] npm ERR!     dev @testing-library/jest-native@"^5.4.0" from the root project
[INSTALL_DEPENDENCIES] npm ERR!   2 more (@testing-library/react-native, jest-expo)
[INSTALL_DEPENDENCIES] npm ERR!
[INSTALL_DEPENDENCIES] npm ERR! Conflicting peer dependency: [email protected]
[INSTALL_DEPENDENCIES] npm ERR! node_modules/react
[INSTALL_DEPENDENCIES] npm ERR!   peer react@"^18.2.0" from [email protected]
[INSTALL_DEPENDENCIES] npm ERR!   node_modules/react-test-renderer
[INSTALL_DEPENDENCIES] npm ERR!     dev react-test-renderer@"^18.2.0" from the root project
[INSTALL_DEPENDENCIES] npm ERR!     peer react-test-renderer@">=16.0.0" from @testing-library/[email protected]
[INSTALL_DEPENDENCIES] npm ERR!     node_modules/@testing-library/jest-native
[INSTALL_DEPENDENCIES] npm ERR!       dev @testing-library/jest-native@"^5.4.0" from the root project
[INSTALL_DEPENDENCIES] npm ERR!     2 more (@testing-library/react-native, jest-expo)

from jest-native.

mdjastrzebski avatar mdjastrzebski commented on June 8, 2024

@ADavisDon You have a mismatch between react and react-test-renderer packages. They must have the exact same version.

from jest-native.

mdjastrzebski avatar mdjastrzebski commented on June 8, 2024

Closing as the OP is no longer responding, so there is no way to figure out if this is config issue or JN issue.

from jest-native.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.