У меня есть приложение create-реакции-native-app с Expo, и я хочу установить модуль реакции-native-внешнего вида для переключения App-Theme на основе настроек ОС.
Вот мой код из Приложение. js
import React from "react";
import AppContainer from "./navigation/navigation";
import { AppearanceProvider, useColorScheme } from "react-native-appearance";
export default class App extends React.Component {
render() {
let theme = useColorScheme();
return (
<AppearanceProvider>
<AppContainer theme={theme} />
</AppearanceProvider>
);
}
}
И это ошибка:
While trying to resolve module 'react-native-appearance' from file **/**/**/App.js, the
package **/**/**//node_modules/react-native-appearance/package.json` was successfully
found. However, this package itself specifies a `main`module field that could not be
resolved (`/***/****/****/****/****/****/node_modules/react-native-
appearance/src/index`. Indeed, none of these files exist:
/Users/mbolender/Productive/project/frontend/frontend/node_modules/
react-native-appearance/src/index(.native|.ios.js|.native.js|.js|.ios.jsx|.native.jsx|
.jsx|.ios.scss|.native.scss|.scss|.ios.sass|.native.sass|.sass|.ios.json|.native.json|.json
/Users/mbolender/Productive/project/frontend/frontend/node_modules/react-native-appearance
/src/index/index(.native|.ios.js|.native.js|.js|.ios.jsx|.native.jsx|
.jsx|.ios.scss|.native.scss|.sass.ios.json|.native.json|.json
Failed building JavaScript bundle.
И я уже следовал решению удалить ./node_modules + закрыть expo builder и переустановить ./ node_modules. Но это не помогло