1
我嘗試添加權限模塊在我們的應用程序,使用流量問題:「需要的模塊找不到」
當我試圖用這樣的:
import Permissions from 'react-native-permissions'
在運行時,我得到了以下錯誤:
file: 'file/RunTimePermissionsExample.js'
severity: 'Error'
message: 'react-native-permissions (Required module not found)'
at: '8,25'
source: 'flow'
注
我已通過這些問題的了: https://github.com/facebook/flow/issues/2092, https://github.com/facebook/flow/issues/3875, Flow required module not found ,並試圖在他們提出不同的方法,如:
- 添加這下選項.flowconfig:
module.name_mapper='(react-native-permissions)' -> 'empty/object'
- 將此項添加到選項中的.flowconfig
module.name_mapper='(react-native-permissions)' -> '/flow/GeneralStub.js.flow'
添加此下[LIB]至.flowconfig
聲明模塊 '反應天然的權限'{ 聲明module.exports:任何; }
- 添加這下選項.flowconfig:
不幸的是,沒有得到解決的錯誤。
其他信息
- 陣營原生版本:〜0.48.4
- 陣營:16.0.0
- 流斌:0.38.0
- eslint:4.8.0,
- babel-preset-flow:6.23.0
- 平臺:[Android 5.1及以上版本]
- 開發操作系統:Windows 7專業版]
- 開發工具:Android的Studio版本2.3.2,Android SDK中23.1.2]
你忽略了'node_modules'嗎?如果是這樣,請嘗試'flow-typed'並安裝def或創建存根 –
謝謝@FezVrasta它已被修復 –