需要未知模块“缓冲区"在 react-native-route-flux [英] Requiring unknown module "buffer" in react-native-route-flux
问题描述
我导入了 react-native-route-flux 并尝试在 genny 运动模拟器中运行该应用程序,即使在我们在 react native init 之后创建的基本示例应用程序中,我也遇到了这种错误.
I import react-native-route-flux and tried to run the application in genny motion emulator I got this kind of error even in the basic sample app that we create after react native init.
需要未知模块缓冲区"
import { Router, Scene } from 'react-native-router-flux';
这是我在 package.json 中的内容
This is what i have in package.json
{
"name": "HelloFlux",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start"
},
"dependencies": {
"react": "^15.0.2",
"react-native": "^0.26.0",
"react-native-router-flux": "^3.22.23"
}
}
前几天它工作正常.
推荐答案
根据 this,assert
库存在一些依赖性问题.
According to this, there are some dependency issues with the assert
lib.
修复的最佳解决方案,强制使用旧版本的损坏的 dep:
Best solution for a fix, force an older version of the broken dep:
npm install --save assert@1.3.0
另一个对我有用的解决方案(sorta),从github安装:
Another solution that worked for me (sorta), install from github:
npm install --save aksonov/react-native-router-flux
这篇关于需要未知模块“缓冲区"在 react-native-route-flux的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!