2

I am unable to run my react native app using expo

Here is the full error that I get once I run npm start with my expo setup. previously I have run these commands: expo init ./ selected minimal setup.

Full error message:

    npm start

> primalone@1.0.0 start
> expo start --dev-client

Starting project at /Users/priyamshah/Desktop/react-native/PRIMALONE
Starting Metro Bundler
jest-haste-map: Watchman crawl failed. Retrying once with node crawler.
  Usually this happens when watchman isn't running. Create an empty `.watchmanconfig` file in your project's root folder or initialize a git or hg repository in your project.
  Error: Watchman error: std::__1::system_error: open: /Users/priyamshah/Desktop/react-native/PRIMALONE: Operation not permitted. Make sure watchman is running for this project. See https://facebook.github.io/watchman/docs/troubleshooting.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
█ ▄▄▄▄▄ █▄▀▀▄▄▀▀█▄█ ▄▄▄▄▄ █
█ █   █ ███▄█  ▀▀▄█ █   █ █
█ █▄▄▄█ ██▄▀▄▀███▀█ █▄▄▄█ █
█▄▄▄▄▄▄▄█ █ ▀▄▀ █ █▄▄▄▄▄▄▄█
█ ▄▀▄▄▀▄█▀ ▄▄▀▀█ ██▄▀▀▀▀▀▄█
█▀▀▀▀▀█▄▄▀▀  ▀█▄  ▄▄ ▀ ▀▀ █
█▀ ▄█▀ ▄▀▄▄█▄▄▀▄ ▀█▄▄▀██▀▄█
█ ▄▄   ▄▀▀██ ▄▄█ █▀  █▄ ▄ █
█▄████▄▄█ █ ▀▀▀▄█ ▄▄▄ █▄ ██
█ ▄▄▄▄▄ ██ █▄▀█▀▀ █▄█ ▄█▀ █
█ █   █ █ █▄█▄▄ ▄   ▄▄ █  █
█ █▄▄▄█ █▀▀▀█▄█ ▄▄▄█  █   █
█▄▄▄▄▄▄▄█▄▄███▄▄█▄▄▄██▄██▄█

› Metro waiting on http://localhost:8081
› Scan the QR code above with Expo Go (Android) or the Camera app (iOS)

› Press a │ open Android
› Press i │ open iOS simulator
› Press w │ open web

› Press r │ reload app
› Press m │ toggle menu

› Press ? │ show all commands

Logs for your project will appear below. Press Ctrl+C to exit.
events.js:377
      throw er; // Unhandled 'error' event
      ^

Error: std::__1::system_error: open: /Users/priyamshah/Desktop/react-native/PRIMALONE: Operation not permitted
    at BunserBuf.<anonymous> (/Users/priyamshah/Desktop/react-native/PRIMALONE/node_modules/fb-watchman/index.js:99:23)
    at BunserBuf.emit (events.js:400:28)
    at BunserBuf.process (/Users/priyamshah/Desktop/react-native/PRIMALONE/node_modules/bser/index.js:292:10)
    at /Users/priyamshah/Desktop/react-native/PRIMALONE/node_modules/bser/index.js:247:12
    at processTicksAndRejections (internal/process/task_queues.js:77:11)
Emitted 'error' event on WatchmanWatcher instance at:
    at Client.<anonymous> (/Users/priyamshah/Desktop/react-native/PRIMALONE/node_modules/jest-haste-map/build/watchers/WatchmanWatcher.js:150:10)
    at Client.emit (events.js:400:28)
    at BunserBuf.<anonymous> (/Users/priyamshah/Desktop/react-native/PRIMALONE/node_modules/fb-watchman/index.js:111:12)
    at BunserBuf.emit (events.js:400:28)
    at /Users/priyamshah/Desktop/react-native/PRIMALONE/node_modules/bser/index.js:249:12
    at processTicksAndRejections (internal/process/task_queues.js:77:11) {
  watchmanResponse: {
    error: 'std::__1::system_error: open: /Users/priyamshah/Desktop/react-native/PRIMALONE: Operation not permitted',
    version: '2022.06.06.00'
  }
}

And this is what I get when I do sudo npm start

sudo npm start
Password:

> primalone@1.0.0 start
> expo start --dev-client

Starting project at /Users/priyamshah/Desktop/react-native/PRIMALONE
Starting Metro Bundler
2022-10-01T19:07:08,501: [] Uncaught C++ exception: std::__1::system_error: open: /opt/homebrew/var/run/watchman/root-state: Permission denied

Watchman:  watchman --no-pretty get-sockname returned with exit code=1, signal=null, stderr= 2022-10-01T19:07:08,501: [] Uncaught C++ exception: std::__1::system_error: open: /opt/homebrew/var/run/watchman/root-state: Permission denied

events.js:377
      throw er; // Unhandled 'error' event
      ^

Error: watchman --no-pretty get-sockname returned with exit code=1, signal=null, stderr= 2022-10-01T19:07:08,501: [] Uncaught C++ exception: std::__1::system_error: open: /opt/homebrew/var/run/watchman/root-state: Permission denied

    at ChildProcess.<anonymous> (/Users/priyamshah/Desktop/react-native/PRIMALONE/node_modules/fb-watchman/index.js:203:18)
    at ChildProcess.emit (events.js:400:28)
    at maybeClose (internal/child_process.js:1055:16)
    at Socket.<anonymous> (internal/child_process.js:441:11)
    at Socket.emit (events.js:400:28)
    at Pipe.<anonymous> (net.js:675:12)
Emitted 'error' event on Client instance at:
    at spawnError (/Users/priyamshah/Desktop/react-native/PRIMALONE/node_modules/fb-watchman/index.js:174:10)
    at ChildProcess.<anonymous> (/Users/priyamshah/Desktop/react-native/PRIMALONE/node_modules/fb-watchman/index.js:203:7)
    at ChildProcess.emit (events.js:400:28)
    [... lines matching original stack trace ...]
    at Pipe.<anonymous> (net.js:675:12)

Setup files: enter image description here

I am creating such react-native app for the first time and getting this error in its setup. Gone through yt so but can't resolve it. Thanks in advance.

Fixes tried:

  1. added a watch man file with {} as its body
  2. given full access of files in my MacBook m1 for terminal and vs code
  3. installed expo-cli globally - verified with expo whoami
Priyam
  • 124
  • 3
  • 9

0 Answers0