我通过yarn start
启动metro。另一个终端我运行yarn android
。当应用程序正在安装时,metro终端出现以下错误,metro停止执行:
C:\Users\SAMSUNG\Desktop\ReactNativeProjects\MyApp\node_modules\metro-hermes-compiler\src\emhermesc.js:77
throw ex;
^
Error: EPERM: operation not permitted, lstat 'C:\Users\SAMSUNG\Desktop\ReactNativeProjects\MyApp\node_modules\react-native-gesture-handler\android\build\kotlin\compileDebugKotlin\caches-jvm'
Emitted 'error' event on NodeWatcher instance at:
at NodeWatcher.<anonymous> (C:\Users\SAMSUNG\Desktop\ReactNativeProjects\MyApp\node_modules\sane\src\node_watcher.js:291:16)
at FSReqCallback.oncomplete (fs.js:168:21) {
errno: -4048,
code: 'EPERM',
syscall: 'lstat',
path: 'C:\\Users\\SAMSUNG\\Desktop\\ReactNativeProjects\\MyApp\\node_modules\\react-native-gesture-handler\\android\\build\\kotlin\\compileDebugKotlin\\caches-jvm'
}
当应用程序正在构建时,我再次通过yarn start
启动metro。当应用程序构建完成时,发生以下崩溃:
BUNDLE ./index.js
ERROR TypeError: undefined is not an object (evaluating 'InnerNativeModule.installCoreFunctions')
ERROR Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication). A frequent cause of the
error is that the application entry file path is incorrect.
This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native.
ERROR Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication). A frequent cause of the
error is that the application entry file path is incorrect.
This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native.
我什么都不明白。这些问题发生在我试图添加库@react-navigation/drawer
及其先决条件时:yarn add react-native-gesture-handler react-native-reanimated
3条答案
按热度按时间vc6uscn91#
在Windows 10上也有同样的问题。更改node_watcher.js为我解决了这个问题。我更改了函数isIgnorableFileError,使其适用于error === null,并在NodeWatcher类中使用了此函数。这些更改远不完美,但现在它起作用了。
第一个猜测-当NodeWatcher和构建同时访问一个文件时的权限问题。
下面是
yarn patch-package sane
的结果z3yyvxxp2#
我也有同样的问题。对我来说,安装watchman解决了这个问题。我的Mac电脑里没有watchman设置。它可能会帮助一些人。
9lowa7mx3#
我得到了这个确切的问题,我设法通过清理以前的构建(“android/app/build”删除整个构建文件夹)修复了它。只是以防万一也删除“node_modules”并执行
npm i
或yarn
。最后,运行项目yarn start --reset-cache
然后yarn android
。