小编Chr*_*ris的帖子

找不到模块'setupDevtools'React-Native

我收到以下错误:

Cannot find module 'setupDevtools' from 'setup.js'

  at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:169:17
Run Code Online (Sandbox Code Playgroud)

我的JSON.package文件如下所示:

{
  "name": "MiBase",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "node node_modules/react-native/local-cli/cli.js start",
    "test": "jest"
  },
  "dependencies": {
    "babel-preset-env": "^1.7.0",
    "i": "^0.3.6",
    "jest-react-native": "^18.0.0",
    "react": "16.3.1",
    "react-native": "0.55.3",
    "react-native-datepicker": "^1.7.2",
    "react-native-image-picker": "^0.26.7",
    "react-native-ui-xg": "0.0.6",
    "react-navigation": "^1.5.11"
  },
  "devDependencies": {
    "babel-jest": "^22.4.3",
    "babel-preset-react-native": "3.0.0",
    "jest": "22.4.3",
    "react-test-renderer": "^16.3.1"
  },
  "jest": {
     "preset": "react-native",
     "moduleNameMapper": {
     "\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/__tests__/loginTest.js",
     "\\.(css|sass)$": "<rootDir>/__tests__/loginTest.js"
   },
   "transformIgnorePatterns": [
     "node_modules"
   ],
   "coveragePathIgnorePatterns": [
     "node_modules"
   ],
     "modulePathIgnorePatterns": [ …
Run Code Online (Sandbox Code Playgroud)

javascript jestjs react-native

5
推荐指数
1
解决办法
1728
查看次数

标签 统计

javascript ×1

jestjs ×1

react-native ×1