Mani Shooshtari
Mani Shooshtari

Reputation: 780

React Native 0.61.2: pod install throws Cannot read property 'projectPath' of undefined

I had the RN version 0.57.4 and used the React Native update-helper to update to 0.61.2. I updated all files and on the final step, I added the Podfile in ios directory and ran pod install (I also ran pod repo update before that).

The pod install throws something like this:

[!] 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
 #  -------------------------------------------


notice the @apollo/react-hooks in the error. @apollo/react-hooks is the first package in my dependencies in node_modules. If I remove it, it will raise an error on the next package on top of dependencies of node_modules!

And all this is because of something happening in use_native_modules! that is trying to do something with the project package dependencies. I don't get that. And I don't know what may be causing that.

Any ideas?

Upvotes: 0

Views: 2083

Answers (1)

Mani Shooshtari
Mani Shooshtari

Reputation: 780

The problem was that I had a react-native-windows dependency in my package.json. Removed that and everything worked fine

Upvotes: 1

Related Questions