react native初学之路--报 operation not permitted错误

时间:2021-01-24 09:26:37

  上午代码还没问题,下午突然就报这个错误了:

  ERROR  EPERM: operation not permitted, lstat 'C:\Users\Administrator\Desktop\ReactNativeUpdate\app\build\generated\assets\shaders\debug'   {"errno":-4048,"code":"EPERM","syscall":"lstat","path":"C:\\Users\\Administrator\\Desktop\\ReactNativeUpdate\\app\\build\\generated\\assets\\shaders\\debug"}   Error: EPERM: operation not permitted, lstat 'C:\Users\Administrator\Desktop\ReactNativeUpdate\app\build\generated\assets\shaders\debug' at Error (native)

  搞不懂什么原因,最后百度知道解决方案:打开项目node_modules/react-native/local-cli/server/server.js 
  找到 process.on('uncaughtException', error =>
  {
 这个方法,把最后一句 process.exit(11); 注释掉。
  再次运行就ok了!