React Native 预期的包,运行expo doctor时发现无效

elcex8rz  于 2022-11-25  发布在  React
关注(0)|答案(3)|浏览(161)

我只是在Expo日志上构建我的应用程序时看到了这个警告。然后我在本地运行Expo doctor,出现了下面的警告。我尝试删除package-lock.json和节点模块,然后运行“npm安装”,但无法修复它。有什么方法可以修复它吗?

expo doctor log:

    √ Found all copies of expo-modules-autolinking
        Expected package expo-modules-autolinking@~0.8.1
        Found invalid:
          expo-modules-autolinking@0.5.5
          (for more info, run: npm why expo-modules-autolinking)
    
        √ Found all copies of @expo/config-plugins
        Expected package @expo/config-plugins@^4.1.0
        Found invalid:
          @expo/config-plugins@4.0.18
          (for more info, run: npm why @expo/config-plugins)
    
        √ Found all copies of @expo/prebuild-config
        Expected package @expo/prebuild-config@^4.0.0
        Found invalid:
          @expo/prebuild-config@3.1.6
          (for more info, run: npm why @expo/prebuild-config)
        
        🎉 Didn't find any issues with the project!

package.json

"@expo/config-plugins": "^4.1.5",
"@expo/prebuild-config": "^4.0.0",
"expo-modules-autolinking": "~0.8.1",
busg9geu

busg9geu1#

将这几行放入您的package.json:

"resolutions": {
  "expo-modules-autolinking": "~0.8.1"
},
swvgeqrz

swvgeqrz2#

对于第45届世博会,请添加以下决议:

"resolutions": {
    "standard-version-expo/**/@expo/config-plugins": "4.1.0"
  },

更多背景信息请点击此处:https://github.com/expo-community/standard-version-expo/issues/45

kx5bkwkv

kx5bkwkv3#

嗨,伙计们,只需添加下面的代码在你的包.json文件(你的项目的根)

"resolutions": {
"@expo/config-plugins": "^4.1.0",
"@expo/prebuild-config": "^4.0.0",
"expo-modules-autolinking": "~0.8.1"
}

相关问题