You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

升级Expo SDK至46后无法git push package-lock.json求助

Expo升级后提交package-lock.json遇Git推送错误

我把Expo SDK从45版本升级到46版本,升级过程顺利,代码也能正常推送。但执行npm install生成package-lock.json文件后,提交这个文件时出现以下报错:

Enumerating objects: 6, done.
Counting objects: 100% (6/6), done.
Delta compression using up to 8 threads
Compressing objects: 100% (4/4), done.
client_loop: send disconnect: Connection reset by peer
fatal: sha1 file '<stdout>' write error: Broken pipe
send-pack: unexpected disconnect while reading sideband packet
fatal: the remote end hung up unexpectedly

我的package.json内容如下:

{
  "jest": {
    "preset": "jest-expo",
    "testURL": "http://localhost/",
    "testEnvironmentOptions": {
      "url": "http://localhost/"
    },
    "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)"
    ],
    "cacheDirectory": "./cache",
    "coveragePathIgnorePatterns": [
      "./app/utils/vendor"
    ],
    "coverageThreshold": {
      "global": {
        "statements": 30
      }
    },
    "setupFilesAfterEnv": [
      "<rootDir>/setupFile.js"
    ]
  },
  "main": "node_modules/expo/AppEntry.js",
  "scripts": {
    "start": "expo start",
    "android": "expo start --android",
    "ios": "expo start --ios",
    "web": "expo start --web",
    "eject": "expo eject",
    "test": "jest --verbose --coverage"
  },
  "dependencies": {
    "@expo/ngrok": "^4.1.0",
    "@expo/vector-icons": "^13.0.0",
    "@freakycoder/react-native-bounceable": "^1.0.3",
    "@react-navigation/material-top-tabs": "^6.2.2",
    "@react-navigation/native": "^6.0.11",
    "@react-navigation/native-stack": "^6.7.0",
    "babel-preset-expo": "~9.2.1",
    "enzyme": "^3.11.0",
    "enzyme-adapter-react-16": "^1.15.6",
    "expo": "^47.0.0",
    "expo-auth-session": "~3.8.0",
    "expo-camera": "~13.1.0",
    "expo-dev-client": "~2.0.1",
    "expo-document-picker": "~11.0.1",
    "expo-image-picker": "~14.0.2",
    "expo-linear-gradient": "~12.0.1",
    "expo-random": "~13.0.0",
    "jest-expo": "^47.0.0",
    "jsdom": "^19.0.0",
    "localstorage-polyfill": "^1.0.1",
    "lodash": "^4.17.21",
    "mime": "^3.0.0",
    "native-base": "^3.4.7",
    "qs": "^6.11.0",
    "radio-buttons-react-native": "^1.0.4",
    "react": "18.1.0",
    "react-dom": "18.1.0",
    "react-native": "0.70.5",
    "react-native-animated-spinkit": "^1.5.2",
    "react-native-awesome-alerts": "^2.0.0",
    "react-native-dropdown-picker": "^5.4.2",
    "react-native-dynamic-search-bar": "^2.0.2",
    "react-native-elements": "^3.4.2",
    "react-native-gesture-handler": "~2.8.0",
    "react-native-image-picker": "^4.10.0",
    "react-native-onboarding-swiper": "^1.2.0",
    "react-native-pager-view": "6.0.1",
    "react-native-paper": "^4.12.4",
    "react-native-safe-area-context": "4.4.1",
    "react-native-screens": "~3.18.0",
    "react-native-svg": "13.4.0",
    "react-native-tab-view": "^3.1.1",
    "react-native-vector-icons": "^9.2.0",
    "react-native-web": "~0.18.7",
    "react-navigation": "^4.4.4"
  },
  "devDependencies": {
    "@babel/core": "^7.19.3",
    "axios": "^0.24.0",
    "babel-jest": "^27.5.1",
    "jest": "^26.6.3",
    "react-router-dom": "^6.1.1",
    "react-test-renderer": "^17.0.2"
  },
  "private": true
}

若需要提供41000行的package-lock.json文件,我可以上传至在线平台或重现报错。我已经尝试过以下方法,但问题仍未解决:

  • 调整Git配置缓冲区
  • 排查项目其他文件
  • 更新Windows11上的Git版本
  • 检查文件权限
  • 移除多余标记
  • 从HTTPS切换至SSH加密

恳请帮助解决此问题。

内容的提问来源于stack exchange,提问作者Niffi

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.25 08:02:53