简体   繁体   English

没有这样的文件或目录 react-native/scripts/libraries

[英]No such file or directory react-native/scripts/libraries

I'm trying to fix this error on github - https://github.com/callstack/react-native-fbads/issues/286 .我正在尝试在 github - https://github.com/callstack/react-native-fbads/issues/286上修复此错误。 I cloned the existing repo and ran it and the error was still there.我克隆了现有的 repo 并运行它,但错误仍然存在。 I am currently updating packages to see why this crash keeps happening, but when I try to upgrade to react-native 0.64 from 0.63.4 i get this error in xcode while trying to run on device or simulator:我目前正在更新软件包以查看为什么此崩溃不断发生,但是当我尝试从 0.63.4 升级到 react-native 0.64 时,我在尝试在设备或模拟器上运行时在 xcode 中收到此错误:

Projects/ReactNative-FBAds-AdChoicesView-Issue/node_modules/react-native/scripts/../Libraries: No such file or directory

seems like when upgrading to 0.64, the libraries folder is no longer in the scripts folder... Any help would be appreciated.似乎升级到 0.64 时,库文件夹不再位于脚本文件夹中......任何帮助将不胜感激。 I'm using the same repo as in the link above and then i run npm install -g npm-check-updates and then ncu -u and then npm install and then cd ios & pod install我使用与上面链接中相同的存储库,然后我运行npm install -g npm-check-updates然后ncu -u然后npm install然后cd ios & pod install

(update - 0.63.4 also does not have the libraries folder in there.) (更新 - 0.63.4 也没有库文件夹。)

This happened also to me upgrading from 0.63 to 0.64.这也发生在我从 0.63 升级到 0.64 的身上。 After trying all solutions I followed a solution moving the folder to a directory where the path contain no spaces and it works and build the app successfully.在尝试了所有解决方案后,我遵循了一个解决方案,将文件夹移动到路径不包含空格的目录,并且它可以正常工作并成功构建应用程序。

Solution to React Native 0.64 build fail React Native 0.64 build 失败的解决方法

In order for this to work properly follow these steps:为了使其正常工作,请执行以下步骤:

  • If you previously installed a global react-native-cli package, please remove it as it may cause unexpected issues (ie npm uninstall -g react-native-cli)如果您之前安装了全局 react-native-cli package,请删除它,因为它可能会导致意外问题(即 npm uninstall -g react-native-cli)
  • Move the project folder in a path with no spaces (ie ~/sub folder name/ReactNativeApp won't work till you have spaces in the path, so move in a path like ~/folder/ReactNativeApp)将项目文件夹移动到没有空格的路径中(即~/子文件夹名称/ReactNativeApp 在路径中有空格之前将不起作用,因此请移入~/folder/ReactNativeApp 之类的路径中)
  • Then cd into the project folder and upgrade react native to the latest version with npx react-native upgrade and resolve conflicts if any然后 cd 进入项目文件夹并使用 npx react-native 升级本机到最新版本并解决冲突(如果有)
  • After upgrading remove the node_modules folder and the yarn.lock from the root and the podfile.lock and Pods folder from ios subfolder升级后从根目录中删除 node_modules 文件夹和 yarn.lock,从 ios 子文件夹中删除 podfile.lock 和 Pods 文件夹
  • Then cd back to the root and run yarn install && npx pod-install然后 cd 回到根目录并运行 yarn install && npx pod-install
  • Now run again your app in Xcode or your IDE and it works现在再次在 Xcode 或 IDE 中运行您的应用程序,它就可以工作了

Crazy and absurd that a space in the path-name could cause this issue路径名中的空格可能会导致此问题,这很疯狂和荒谬

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM