Reactjs Redux persist:无法解析模块'react native'`
我试图在我的第三方NPM模块中使用Reactjs Redux persist:无法解析模块'react native'`,reactjs,typescript,react-native,redux,redux-persist,Reactjs,Typescript,React Native,Redux,Redux Persist,我试图在我的第三方NPM模块中使用redux persist(如果有帮助的话,它使用Typescript)。每当我试图在我的实际项目(这是一个完美工作的React本机应用程序)中使用我的第三方模块(本地符号链接)时,我都会遇到以下错误: error: bundling failed: Error: Unable to resolve module `react-native` from `path/to/my/3rd/party/module/node_modules/redux-persis
redux persist
(如果有帮助的话,它使用Typescript)。每当我试图在我的实际项目(这是一个完美工作的React本机应用程序)中使用我的第三方模块(本地符号链接)时,我都会遇到以下错误:
error: bundling failed: Error: Unable to resolve module `react-native` from
`path/to/my/3rd/party/module/node_modules/redux-persist/lib/storage/index.native.js`:
Module `react-native` does not exist in the Haste module map
Redux persist声明它不需要React(正如它在自述文件中所说的“如果您正在使用React…”,这意味着它也可以在没有React/React Native的情况下使用),为什么我会遇到这样的错误
我尝试过的事情:
- 将
(任何版本)作为对等依赖项添加到我的外部模块react
- 将
(任何版本)作为对等依赖项添加到我的外部模块react native
- 将
安装到我的外部模块react
- 安装
到我的外部模块react native
- 已尝试
版本的@next
,该版本对React的依赖项有一些更改。我也读过,虽然我不知道该怎么办redux persist