如何解决React Native-Pod安装问题“无法加载此类文件.... node_modules / react-native / scripts / react_native_pods”
当我有一个React Native项目时....当我运行df1 = pd.read_csv ('originalfile.csv')
df2 = df1[df1.FolderOwner == 'Roy']
df3 = df2['Path','FolderName','FolderOwner']
df3.to_csv('Royfile.csv')
print(df3)
时,它给我以下错误
pod install
这是我的podfile
Invalid `Podfile` file: cannot load such file -- /myPath/node_modules/react-native/scripts/react_native_pods
已检查,位置require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
platform :ios,'10.0'
target 'xs' do
config = use_native_modules!
use_react_native!(:path => config["reactNativePath"])
target 'xsTests' do
inherit! :complete
# Pods for testing
end
# Enables Flipper.
#
# Note that if you have use_frameworks! enabled,Flipper will not work and
# you should disable these next few lines.
use_flipper!
post_install do |installer|
flipper_post_install(installer)
end
end
target 'xs-tvOS' do
# Pods for xs-tvOS
target 'xs-tvOSTests' do
inherit! :search_paths
# Pods for testing
end
end
中没有名为react_native_pods
的文件。
我想知道是否与myPath/node_modules/react-native/scripts/
相关的问题无法生成正确的文件.....但是我将节点升级到最新版本,然后运行npm install
解决方法
我运行了npm audit fix
,它添加了react_native_pods
文件,然后pod install
开始工作
运行 npm audit fix ==> cd ios ==> pod install
,为了解决这个问题:我所做的是:
- 本机升级:主要升级本机版本,这还将升级您的某些ios文件,例如Podfile等。
尝试一下是否适合您。您还可以创建一个最新的react native项目并使用“超越比较”来比较文件/目录,还需要重命名文件中的某些行。
还请阅读文件中的注释以更好地理解。
,我遇到了同样的错误,可以通过将React Native的版本从0.62升级到0.63来解决,它对我有用 因为版本为0.62时文件夹脚本中不存在该文件react_native_pods,所以当我将RN的版本升级到0.63时出现,在npm install之后出现,在pod安装时可以工作,希望对其他遇到相同问题的人有所帮助错误
,在 Node_Module->React-Native->Scripts->(在此处添加)
中添加 react-native.pods.rb 文件 ,就我而言,我已经删除了 yarn.lock、podfile.lock,并且在再次安装 yarn 和 pod 后它工作正常
,就我而言,首先创建一个新的空白项目,然后将您的项目移至新的空白项目。 然后工作。
,确认你有一个 node_modules 文件夹,我错过了
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。