Instalé RNUI en un nuevo proyecto Expo. Después de simplemente importar el módulo, arroja este error:
Error: Problem validating fields in app.json. See https://docs.expo.io/workflow/configuration/ • should NOT have additional property 'nodeModulesPath'. Failed building JavaScript bundle. Unable to resolve module react-native-haptic-feedback from /Users/xx/Documents/yy/zz/node_modules/react-native-ui-lib/src/optionalDependencies/HapticFeedbackPackage.js: react-native-haptic-feedback could not be found within the project. If you are sure the module exists, try these steps: 1. Clear watchman watches: watchman watch-del-all 2. Delete node_modules and run yarn install 3. Reset Metro's cache: yarn start --reset-cache 4. Remove the cache: rm -rf /tmp/metro-* 2 | 3 | try { > 4 | HapticFeedbackPackage = require('react-native-haptic-feedback').default; | ^ 5 | } catch (error) {} 6 | 7 | export default HapticFeedbackPackage;Me parece muy ilógico que arroje un error dentro de una instrucción try {}. El mismo módulo funcionó bien en un proyecto Expo anterior (versión anterior).
Debe instalar react-native-haptic-feedback este paquete, y luego si no funciona, realice los pasos que se detallan a continuación.
Elimine la carpeta node_modules en el directorio del proyecto, cierre el paquete de metro y todo lo que se está ejecutando para el proyecto. Ahora ejecute npm install, debería funcionar.