React-native-fs 不适用于 React-native 版本 0.69

Jay*_*eth 0 react-native react-native-fs

我正在使用react-native版本0.69,我想读取存储在我的react native项目中的资产中的文件。在中使用以下语法App.js

import fs from 'react-native-fs';

我已经安装了“react-native-fs”并按照我在互联网上找到的所有链接进行操作,但在运行应用程序时仍然遇到以下错误。

ERROR  TypeError: null is not an object (evaluating 'RNFSManager.RNFSFileTypeRegular')
 ERROR  Invariant Violation: "main" has not been registered. This can happen if:
 * Metro (the local dev server) is run from the wrong folder. Check if Metro is running, stop it and restart it in the current 
project.
 * A module failed to load due to an error and `AppRegistry.registerComponent` wasn't called.

Run Code Online (Sandbox Code Playgroud)

我尝试运行,react-native link react-nativs-fs但如官方文档中所述,react-native >= 60 中的链接支持已被删除,我无法使其正常工作,任何帮助将不胜感激。我在 stackoverflow 上看到了类似的问题,但没有人给出 React Native >=0.60 版本的答案

我还使用 expo 来创建应用程序。我的操作系统是 Windows 10 64 位。

小智 5

Expo 不支持react-native-fs,但仅受Pure React Native 支持。

Expo 有一个提供文件系统支持的软件包: expo-file-system