我刚刚将react-native版本从0.30升级到0.48.1,并且遇到了一个奇怪的问题。我修复了我正在使用的库的所有对等依赖性。然后执行命令
反应性开始
运行以上命令将启动打包程序。现在,当我点击以下网址以生成jsbundle时,http:// localhost:8081 / index.android.bundle?platform = android&dev = true&hot = false&minify = false
我遇到错误了,
"message":"Ambiguous resolution: module '$PROJ_ROOT_DIR/index.android.js' tries to require 'react-native', but there are several files providing this module. You can delete or fix them:
$PROJ_ROOT_DIR/node_modules/jest-react-native/node_modules/react-native/package.json
$PROJ_ROOT_DIR/node_modules/react-native/package.json"
$ PROJ_ROOT_DIR是我的项目目录路径。
我的设置中没有任何'$ PROJ_ROOT_DIR / node_modules / jest-react-native / node_modules /'目录。我尝试删除node_modules目录,然后运行npm install。但什么都没有改变。
我也尝试过通过运行命令清除打包程序缓存,
ls -l $ TMPDIR / react- *
但是什么也没发生。
有没有人遇到过类似的问题?有什么建议么?
提前致谢!
万一其他人遇到类似问题,使用以下命令清除缓存对我来说很有用。
npm start--重置缓存
我正在尝试react-native start -- --reset-cache
什么都不做的命令(我的坏事。)。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句