react native 0.68.2在react-native run-android错误之后无法读取未定义的属性(阅读'configurations')

7gyucuyw  于 2022-11-03  发布在  Android
关注(0)|答案(2)|浏览(121)

类型错误:无法读取未定义的属性(阅读'configurations')

在使用react-native run-android运行项目时遇到此问题

at Object.dependencyConfig (/node_modules/@react-native-community/cli-platform-ios/build/config/index.js:102:37)
    at /usr/local/lib/node_modules/react-native/node_modules/@react-native-community/cli-config/build/loadConfig.js:47:61
    at Array.reduce (<anonymous>)
    at getDependencyConfig (/usr/local/lib/node_modules/react-native/node_modules/@react-native-community/cli-config/build/loadConfig.js:44:51)
    at Object.get @ptomasroos/react-native-multi-slider [as @ptomasroos/react-native-multi-slider] (/usr/local/lib/node_modules/react-native/node_modules/@react-native-community/cli-config/build/loadConfig.js:99:18)
    at warnAboutManuallyLinkedLibs (/Users/CBL-MAC/Documents/Project/node_modules/@react-native-community/cli-platform-android/build/link/warnAboutManuallyLinkedLibs.js:39:43)
    at displayWarnings (/Users/CBL-MAC/Documents/Project/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/index.js:82:44)
    at Object.runAndroid [as func] (/Users/CBL-MAC/Documents/Project/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/index.js:97:3)
    at Command.handleAction (/usr/local/lib/node_modules/react-native/node_modules/@react-native-community/cli/build/index.js:192:23)
    at Command.listener (/usr/local/lib/node_modules/react-native/node_modules/commander/index.js:315:8)
ahy6op9u

ahy6op9u1#

如果出现此错误,请响应本机0.68.2

您应该在
节点模块/@React Native社区/cli-platform-ios/构建/配置/index.js

function dependencyConfig(folder, userConfig) {
  comment this line
  // const configurations = userConfig.configurations || [];

  // redeclare again
 var configurations="";
kokeuurv

kokeuurv2#

我们只需要升级@react-native-community/cli

npm i -g @react-native-community/cli@7.0.4

相关问题