I am trying to integrate latest RN project into native project. Both project are in separate directories that means my native project does not exist in predefined ios folder.
versions:
RN Native: 0.63.3 @react-native-community/cli: 4.13.0 installed globally using yarn global add @react-native-community/cli.
I am getting error stating react-native-community package not found.
My pod file is mentioned below:
require_relative '../AwesomeProject/node_modules/react-native/scripts/react_native_pods'
require_relative '../AwesomeProject/node_modules/@react-native-community/cli-platform-ios/native_modules'
platform :ios, '10.0'
use_frameworks!
def main_pods
config = use_native_modules!
use_react_native!(:path => config["reactNativePath"])
end
target 'NativeFramework' do
main_pods
end
target 'Example' do
main_pods
end
Error:
[!] Invalid `Podfile` file: [!] /usr/local/bin/node -e try {console.log(require('@react-native-community/cli').bin);} catch (e) {console.log(require('react-native/cli').bin);}
internal/modules/cjs/loader.js:968
throw err;
^
Error: Cannot find module 'react-native/cli'
You say you've installed @react-native-community/cli
with Yarn. The error message indicates that may not be working for you. It's not surprising, because your Podfile says it can be found in a subdirectory of your project.
Why not install with npm
and see what happens?
cd
to AwesomeProject npm i @react-native-community/cli
Alternatively, change your Podfile so it refers to the global location.
出于某种奇怪的原因,它与 yarn install 一起工作,然后进行 pod install
react-native": "0.68.2" java11 Apple M1 Pro
After so much times passed, I found the problem is that the android-project dir must be in the react-native-project dir !
rvm reset rvm install 2.7.2 rvm get stable --auto-dotfiles
delete dependencyResolutionManagement in settings.gradle, add to allprojects.repositories to root build.gradle
# try sudo ln -s "$(which node)" /usr/local/bin/node open -a /Applications/Android\ Studio.app
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.