React本机更新v0.66.4后需要逗号或右大括号json(518)

js4nwp54  于 2023-03-19  发布在  React
关注(0)|答案(1)|浏览(126)

在将React Native从v0.63.3升级到v0.66.4(后面是RN Upgrade Helper)后,我收到一个错误,该错误源自 node_modules/jest-resolve/node_modules/resolve/test/resolver/malformed_package_json/package.json。如何抑制或修复此错误?
错误:应为逗号或右大括号json(518)-json文件仅包含开始“{”标记。
依赖关系:

{
  ...
  "dependencies": {
    "@babel/polyfill": "7.0.0-beta.47",
    "@babel/preset-env": "^7.5.5",
    "@bugsnag/js": "^7.9.2",
    "@bugsnag/plugin-react": "^7.9.2",
    "@bugsnag/react-native": "^7.9.4",
    "@monterosa/react-native-parallax-scroll": "https://github.com/xxxxxxxx/react-native-parallax-scroll.git#xxxxxxxxx",
    "@react-native-async-storage/async-storage": "^1.15.4",
    "@react-native-community/blur": "git+https://github.com/thedeepanshujain/react-native-blur.git#xxxxxxx",
    "abortcontroller-polyfill": "^1.1.9",
    "date-fns": "^1.29.0",
    "debug": "^3.1.0",
    "eslint-plugin-import": "^2.11.0",
    "expr-eval": "^2.0.2",
    "formik": "1.5.1",
    "iban": "^0.0.10",
    "mobx": "^4.3.1",
    "mobx-react": "^5.2.3",
    "mobx-react-lite": "^1.4.1",
    "mobx-react-router": "^4.0.5",
    "modal-react-native-web": "^0.2.0",
    "patch-package": "https://github.com/xxxxxxxx/patch-package.git#xxxxxxxxx",
    "qs": "^6.5.1",
    "react": "17.0.2",
    "react-dom": "16.14.0",
    "react-dropzone": "^5.1.0",
    "react-fast-compare": "^2.0.4",
    "react-native": "0.66.4",
    "react-native-actionsheet": "https://github.com/xxxxxxxx/react-native-actionsheet.git#xxxxxxxx",
    "react-native-calendars": "1.1260.0",
    "react-native-collapsible": "^1.6.0",
    "react-native-device-info": "^5.5.3",
    "react-native-document-picker": "^3.2.4",
    "react-native-dropdownalert": "https://github.com/xxxxxxxxx/react-native-dropdownalert.git#xxxxxxxx",
    "react-native-extra-dimensions-android": "https://github.com/xxxxxxxxx/react-native-extra-dimensions-android.git#xxxxxxxxx",
    "react-native-fs": "^2.14.1",
    "react-native-google-analytics-bridge": "^7.1.0",
    "react-native-i18n": "git+https://github.com/lemankk/react-native-i18n.git#xxxxxxx",
    "react-native-image-capinsets": "https://github.com/xxxxxxxx/react-native-image-capinsets.git#xxxxxxxx",
    "react-native-image-crop-picker": "^0.25.0",
    "react-native-image-zoom-viewer": "^2.2.26",
    "react-native-ios-launch-arguments": "^1.1.0",
    "react-native-iphone-x-helper": "^1.3.1",
    "react-native-keyboard-manager": "4.0.13-15",
    "react-native-linear-gradient": "^2.4.0",
    "react-native-loading-placeholder": "^0.0.6",
    "react-native-locale": "^0.0.19",
    "react-native-pdf": "^5.0.6",
    "react-native-safari-view": "^2.1.0",
    "react-native-safe-area-context": "^3.1.9",
    "react-native-segmented-control-tab": "^3.2.2",
    "react-native-splash-screen": "3.2.0",
    "react-native-svg": "12.1.1",
    "react-native-touch-id": "git+https://github.com/xxxxxxxx/react-native-touch-id.git#xxxxxxx",
    "react-native-version-number": "https://github.com/xxxxxxxx/react-native-version-number.git#xxxxxxx",
    "react-native-web": "^0.14.0",
    "react-native-web-linear-gradient": "^1.0.2",
    "react-native-web-webview": "^0.2.5",
    "react-native-webview": "10.10.0",
    "react-navigation": "2.11.2",
    "react-router": "^4.2.0",
    "react-router-dom": "^4.2.2",
    "resize-observer-polyfill": "^1.5.0",
    "rn-fetch-blob": "^0.10.16",
    "url-search-params": "^1.0.2",
    "victory": "^32.0.2",
    "victory-native": "^32.0.2"
  },
  "devDependencies": {
    "@babel/core": "^7.12.9",
    "@babel/eslint-parser": "^7.16.5",
    "@babel/eslint-plugin": "^7.16.5",
    "@babel/plugin-proposal-do-expressions": "^7.8.3",
    "@babel/plugin-proposal-function-bind": "^7.8.3",
    "@babel/plugin-proposal-nullish-coalescing-operator": "^7.8.3",
    "@babel/plugin-proposal-optional-chaining": "^7.8.3",
    "@babel/plugin-syntax-class-properties": "^7.8.3",
    "@babel/plugin-syntax-do-expressions": "^7.8.3",
    "@babel/plugin-transform-flow-strip-types": "^7.8.3",
    "@babel/plugin-transform-react-jsx-source": "^7.8.3",
    "@babel/plugin-transform-runtime": "^7.8.3",
    "@babel/runtime": "^7.12.5",
    "@bugsnag/source-maps": "^2.0.0",
    "babel-jest": "^26.6.3",
    "babel-loader": "^8.0.0",
    "babel-plugin-lodash": "^3.3.4",
    "babel-plugin-react-native-web": "^0.4.0",
    "babel-plugin-transform-decorators-legacy": "^1.3.5",
    "babel-plugin-transform-inline-environment-variables": "^0.4.3",
    "bugsnag-build-reporter": "^1.0.3",
    "copy-webpack-plugin": "^4.5.2",
    "eslint": "7.14.0",
    "eslint-plugin-flowtype": "^6.1.1",
    "eslint-plugin-react": "^7.28.0",
    "eslint-plugin-react-native": "^3.11.0",
    "file-loader": "^6.0.0",
    "flow-babel-webpack-plugin": "^1.1.1",
    "flow-bin": "^0.158.0",
    "hard-source-webpack-plugin": "^0.12.0",
    "html-webpack-plugin": "^3.2.0",
    "husky": "1.0.0-rc.13",
    "jest": "^26.6.3",
    "jetifier": "^1.6.3",
    "metro-react-native-babel-preset": "^0.66.2",
    "nodemon": "^1.18.3",
    "npm-license-crawler": "^0.1.9",
    "npm-run-all": "^4.1.2",
    "prettier": "1.18.2",
    "pretty-quick": "^1.4.1",
    "raw-loader": "^0.5.1",
    "react-art": "^16.4.2",
    "react-test-renderer": "17.0.2",
    "speed-measure-webpack-plugin": "^1.2.2",
    "url-loader": "^1.1.1",
    "webpack": "^4.17.0",
    "webpack-bugsnag-plugins": "^1.6.0",
    "webpack-bundle-analyzer": "^2.13.1",
    "webpack-cli": "^3.1.0",
    "webpack-dev-server": "^3.1.6",
    "why-did-you-update": "^1.0.6"
  },
  "jest": {
    "preset": "react-native",
    "transform": {
      "^.+\\.js$": "<rootDir>/node_modules/react-native/jest/preprocessor.js"
    },
    "transformIgnorePatterns": [
      "node_modules/(?!(react-native|react-native-.+)/)"
    ],
    "testPathIgnorePatterns": [
      "/node_modules/",
      "<rootDir>/__tests__/testLib/"
    ],
    "setupFilesAfterEnv": [
      "<rootDir>/jest-setup.js"
    ]
  }
}
jchrr9hc

jchrr9hc1#

删除第2行中的...,然后重试。(大括号后)

相关问题