React Native 0.61.2:pod安装抛出无法读取未定义的属性'projectPath'

时间:2019-10-13 13:28:33

标签: react-native cocoa cocoapods

我的RN版本为0.57.4,并使用React Native更新帮助器更新至0.61.2。我更新了所有文件,并在最后一步中,在Podfile目录中添加了ios并运行了pod install(在此之前我也运行了pod repo update)。

pod安装抛出以下内容:

[!] Invalid `Podfile` file: 784: unexpected token at 'TypeError: Cannot read property 'projectPath' of undefined

    at Object.dependencyConfigWindows [as dependencyConfig] (/Users/mani/Development/Projects/ouranous-studio/supernova/node_modules/react-native-windows/local-cli/core/windows/index.js:59:34)

    at platforms.Object.keys.reduce (/Users/mani/Development/Projects/ouranous-studio/supernova/node_modules/@react-native-community/cli/build/tools/config/index.js:87:61)

    at Array.reduce (<anonymous>)

    at getDependencyConfig (/Users/mani/Development/Projects/ouranous-studio/supernova/node_modules/@react-native-community/cli/build/tools/config/index.js:84:51)

    at Object.get @apollo/react-hooks [as @apollo/react-hooks] (/Users/mani/Development/Projects/ouranous-studio/supernova/node_modules/@react-native-community/cli/build/tools/config/index.js:201:18)

    at Object.keys.forEach.item (/Users/mani/Development/Projects/ouranous-studio/supernova/node_modules/@react-native-community/cli/build/commands/config/config.js:20:51)

    at Array.forEach (<anonymous>)

    at filterConfig (/Users/mani/Development/Projects/ouranous-studio/supernova/node_modules/@react-native-community/cli/build/commands/config/config.js:19:38)

    at Object.func (/Users/mani/Development/Projects/ouranous-studio/supernova/node_modules/@react-native-community/cli/build/commands/config/config.js:31:32)

    at Command.handleAction (/Users/mani/Development/Projects/ouranous-studio/supernova/node_modules/@react-native-community/cli/build/cliEntry.js:160:21)
'.

 #  from /Users/mani/Development/Projects/ouranous-studio/supernova/ios/Podfile:42
 #  -------------------------------------------
 #  
 >    use_native_modules!
 #  end
 #  -------------------------------------------


在错误中通知@apollo/react-hooks@apollo/react-hooks是我dependenciesnode_modules中的第一个软件包。如果删除它,它将在node_modules依赖项之上的下一个包中引发错误!

所有这一切都是由于use_native_modules!中发生的某件事正在尝试对项目包依赖项进行某些操作。我不明白而且我不知道是什么原因造成的。

有什么想法吗?

1 个答案:

答案 0 :(得分:0)

问题是我的package.json中有一个react-native-windows依赖项。删除了,一切正常