40

I'm cloning an existing react native app in my local environment, but every time I run react-native run-ios I get the following error:

** 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

And this error in 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.

I only get this error when I run react-native run-ios for a repo I cloned. But when I create a new react-native app everything works fine. I tried everything: killing the servers, uninstalling and installing node again, deleting my node_modules file, etc and still I can't solve this issue. Any help would be much appreciated. Thanks.

Michael Sivolobov
  • 12,388
  • 3
  • 43
  • 64
Aly Dabbous
  • 567
  • 1
  • 6
  • 14

8 Answers8

55

For me I uninstalled watchman and then reinstalled it using brew as shown below:

npm r -g watchman 
brew install watchman
Felix Too
  • 11,614
  • 5
  • 24
  • 25
  • 4
    Using MacOS Catalina and ElectronJS, and this was the only solution that worked for me – bozdoz Feb 05 '20 at 16:23
  • 3
    I can confirm that this works for me too in the macOS Monterey. The brew command installed a lot of things and took about 5 minutes to complete. – Arefe May 16 '22 at 03:13
24
npm install -g fsevents

Worked for me

Sid Jonnala
  • 485
  • 4
  • 11
7

I faced the following issue while coding a react native app. It seemed to be an error with watchman, so all we need is to re-install it:

brew remove watchman

brew install watchman

I hope it helps,

Whit Waldo
  • 4,806
  • 4
  • 48
  • 70
mahmoud mehdi
  • 1,493
  • 1
  • 19
  • 28
4

I got the same error when trying to run jest watch. Simple solution for me was to install the fsevents module through npm (which I assume this is what your error message is telling you). I was also working with a React app and had additional similar errors.

Hope this helps!

Jonathan Bareket
  • 318
  • 2
  • 12
  • 1
    don't know why in the world this worked but yes, I was getting fsevents problems with multiple versions of yarn add. When I switched to npm it worked. WTH but thanks for the suggestion. – ether_joe Nov 16 '19 at 19:34
4

This happened in a create-react-app for me. I resolved this by updating react-scripts

yarn add react-scripts@latest

Then deleting node_modules, and re-installing

yarn

tic
  • 2,484
  • 1
  • 21
  • 33
1

Sometimes this issue could be related to the node version you are running. If you are using nvm, try switching to a different node version and see if it fixes. It worked for me on a similar issue.

Manoj Amalraj
  • 535
  • 1
  • 5
  • 14
1

Uninstalling watchman and then reinstalling with brew worked:

npm r -g watchman

then

brew install watchman
Mo.
  • 26,306
  • 36
  • 159
  • 225
Michael
  • 11
  • 2
0

In my case, following a MacOS update, I needed the updated version of yarn.

curl --compressed -o- -L https://yarnpkg.com/install.sh | bash
Carl Manaster
  • 39,912
  • 17
  • 102
  • 155