event.js:174 throw er// unhandled 'error' event operation not permitted

Viewed 1097

I get this every time I try and deploy my app to android and it breaks my metro server.

I have tried updating my environment variables.

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

Error: EPERM: operation not permitted, lstat 'C:\Users\user\Documents\DEV\react-native-dualscreen\dualscreeninfo\examples\android\app\build\generated\not_namespaced_r_class_sources\debug\processDebugResources\r\androidx\lifecycle\viewmodel'
Emitted 'error' event at:
    at NodeWatcher.<anonymous> (C:\Users\user\Documents\DEV\react-native-dualscreen\dualscreeninfo\examples\node_modules\sane\src\node_watcher.js:291:16)
    at FSReqWrap.oncomplete (fs.js:153:21)
1 Answers

I guess this issue happens because of your Windows env path setting, the exact solution is: add %SystemRoot%\system32 to your PATH, follow the below steps:

  1. Right-click My Computer on your desktop.
  2. Click Properties.
  3. In the System Properties window, click the Advanced tab and then click Environment Variables.
  4. In the System Variables window, highlight Path, and click Edit.
  5. In the Edit System Variables window, insert the cursor at the end of the Variable value field.
  6. If the last character is not a semi-colon (;), add one.
  7. After the final semi-colon, type the full path to the file you want to find.
    %SystemRoot%\system32
    
  8. Click OK in each open window
  9. Restart System

Hint: remember, you should restart your system. after restarting this issue will be disappeared.

Related