【问题标题】:React Native : Cannot read property 'Document Dir' of undefined when importing react-native-fetch-blobReact Native:导入 react-native-fetch-blob 时无法读取未定义的属性“文档目录”
【发布时间】:2018-05-31 06:07:32
【问题描述】:

我试图在我的项目中使用 react-native-fetch-blob,但是每当我放一个

import RNFetchBlob from 'react-native-fetch-blob'

我在模拟器上遇到错误

Cannot read property 'Document Dir' of undefined

我已经使用

安装了它
npm i --save react-native-fetch-blob

并使用链接它

react-native link

错误:

无法读取未定义的属性“DocumentDir” fs.js:24:31 加载模块实现 require.js:214:4 受保护的LoadModule 需要.js:148:11 _要求 需要.js:132:2 index.js:21 加载模块实现 require.js:214:4 受保护的LoadModule 需要.js:148:11 _要求 需要.js:132:2 App.js:6 加载模块实现 需要.js:214:4

【问题讨论】:

标签: react-native react-native-fetch-blob


【解决方案1】:

安装和链接包之后。执行以下操作

watchman watch-del-all

npm cache clean --force

rm -f /ios/build(如果你正在为 ios 构建) rm -f /android/build(如果你正在为安卓构建)

react-native run-ios `or` react-native run-ios

希望它能解决你的问题

【讨论】:

    猜你喜欢
    • 2018-06-05
    • 1970-01-01
    • 2018-10-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多