简体   繁体   English

反应原生升级后反应原生 iOS 构建失败

[英]React Native iOS build failed after react native upgrade

Upgraded the react native app from v0.65.1 to v0.67.0.将 react native 应用从 v0.65.1 升级到 v0.67.0。 The build failed with the below error.构建失败并出现以下错误。 Tried deleting the node modules, pods and installed them again and still facing the issue.尝试删除节点模块、pod 并再次安装它们,但仍然面临问题。 The Xcode version is 13.4.1. Xcode 版本是 13.4.1。 在此处输入图像描述

May be Xcode is using an outdated version of Node (in my case, it was because I use nvm to manage my Node versions, but Xcode used an old version of Node that I had installed via HomeBrew a long time ago).可能是 Xcode 使用的是过时的 Node 版本(在我的情况下,这是因为我使用 nvm 来管理我的 Node 版本,但是 Xcode 使用了很久以前通过 HomeBrew 安装的旧版本的 Node)。

By default, Xcode will use the Node binary located at /usr/local/bin/node.默认情况下,Xcode 将使用位于 /usr/local/bin/node 的 Node 二进制文件。 Check its version by running:通过运行检查其版本:

/usr/local/bin/node -v
node -v

If the first command outputs an older version of Node, simply delete it and replace it with a symlink to the newer one:如果第一个命令输出的是旧版本的 Node,只需将其删除并用指向新版本的符号链接替换它:

rm -rf /usr/local/bin/node
ln -s $(which node) /usr/local/bin/node

The solution to the error was easy.错误的解决方案很简单。 Checked the path to the project folder.检查项目文件夹的路径。 The folder name has a space in-between.文件夹名称之间有一个空格。 Renamed the folder by removing all the spaces in-between.通过删除中间的所有空格来重命名文件夹。 Tried to run the project and it worked.尝试运行该项目并且它有效。 Not sure why it ran with this fix.不知道为什么它使用此修复程序运行。

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

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