33

我正在本地环境中克隆现有的 react 本机应用程序,但每次运行时react-native run-ios都会出现以下错误:

** BUILD FAILED **


The following commands produced analyzer issues:
    Analyze /Users/alydabbous/code/Dabbous-Innopay/ideal-app/node_modules/react-native/ReactCommon/yoga/yoga/YGNodeList.c normal x86_64

    Analyze /Users/alydabbous/code/Dabbous-Innopay/ideal-app/node_modules/react-native/ReactCommon/yoga/yoga/Yoga.c normal x86_64
    Analyze Base/RCTModuleMethod.mm normal x86_64
(3 commands with analyzer issues)

The following build commands failed:
    Ld build/Build/Products/Debug-iphonesimulator/MyUros.app/MyUros normal x86_64
(1 failure)

Installing build/Build/Products/Debug-iphonesimulator/TPP.app
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=2):
Failed to install the requested application
An application bundle was not found at the provided path.
Provide a valid path to the desired application bundle.
Print: Entry, ":CFBundleIdentifier", Does Not Exist

Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/TPP.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist

react-packager 中的这个错误:

Loading dependency graph...(node:52097) UnhandledPromiseRejectionWarning: Error: `fsevents` unavailable (this watcher can only be used on Darwin)
    at new FSEventsWatcher (/Users/alydabbous/code/Dabbous-Innopay/ideal-app/node_modules/sane/src/fsevents_watcher.js:41:11)
    at createWatcher (/Users/alydabbous/code/Dabbous-Innopay/ideal-app/node_modules/jest-haste-map/build/index.js:600:23)
    at Array.map (<anonymous>)
    at HasteMap._watch (/Users/alydabbous/code/Dabbous-Innopay/ideal-app/node_modules/jest-haste-map/build/index.js:747:25)
    at _buildPromise._buildFileMap.then.then.hasteMap (/Users/alydabbous/code/Dabbous-Innopay/ideal-app/node_modules/jest-haste-map/build/index.js:279:21)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:189:7)
(node:52097) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:52097) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

当我运行react-native run-ios我克隆的 repo 时,我只会收到此错误。但是当我创建一个新的 react-native 应用程序时,一切正常。我尝试了一切:杀死服务器,再次卸载和安装节点,删除我的 node_modules 文件等,但我仍然无法解决这个问题。任何帮助将非常感激。谢谢。

4

8 回答 8

45

对我来说,我卸载watchman然后重新安装它brew,如下所示:

npm r -g watchman 
brew install watchman
于 2018-11-28T13:33:33.150 回答
21
npm install -g fsevents

为我工作

于 2019-01-23T01:01:38.500 回答
6

在编写反应原生应用程序时,我遇到了以下问题。这似乎是 watchman 的错误,所以我们需要重新安装它:

brew remove watchman

brew install watchman

我希望它有所帮助,

于 2020-04-12T20:19:34.980 回答
4

尝试运行 jest watch 时出现同样的错误。对我来说简单的解决方案是通过 npm 安装 fsevents 模块(我假设这是您的错误消息告诉您的内容)。我也在使用 React 应用程序,并且遇到了其他类似的错误。

希望这可以帮助!

于 2018-10-11T10:27:05.180 回答
3

这发生在create-react-app我身上。我通过更新解决了这个问题react-scripts

yarn add react-scripts@latest

然后删除node_modules,重新安装

yarn

于 2020-01-13T23:31:45.137 回答
1

卸载 watchman,然后使用 brew 重新安装:

npm r -g 守望者

酿造安装守望者

于 2021-04-23T15:35:51.273 回答
0

有时此问题可能与您正在运行的节点版本有关。如果您使用的是 nvm,请尝试切换到不同的节点版本并查看它是否修复。它在类似的问题上对我有用。

于 2019-06-10T16:08:59.733 回答
0

就我而言,在 MacOS 更新之后,我需要更新版本的yarn.

curl --compressed -o- -L https://yarnpkg.com/install.sh | bash
于 2019-04-03T15:42:32.710 回答