ReactNative might be related to https://github.com/facebook/react-native/issues/4968

1. 摘要

        ReactNative在开发的时候,会遇到很多坑。需要我们根据日志来解决。把解决经过记录下来,方便之后的开发人员来搜索解决办法。


2. 日志

Loading dependency graph, done.

error: bundling: UnableToResolveError: Unable to resolve module `react/lib/ReactDebugCurrentFrame` from `/Users/afunx/Code/reactive/dn/rn_project/node_modules/react-native/Libraries/Renderer/src/renderers/shared/stack/reconciler/ReactCompositeComponent.js`: Module does not exist in the module map or in these directories:

  /Users/afunx/Code/reactive/dn/rn_project/node_modules/react/lib


This might be related to https://github.com/facebook/react-native/issues/4968

To resolve try the following:

  1. Clear watchman watches: `watchman watch-del-all`.

  2. Delete the `node_modules` folder: `rm -rf node_modules && npm install`.

  3. Reset packager cache: `rm -fr $TMPDIR/react-*` or `npm start --reset-cache`.

    at p.catch.error (/Users/afunx/Code/reactive/dn/rn_project/node_modules/react-native/packager/src/node-haste/DependencyGraph/ResolutionRequest.js:366:19)

    at process._tickCallback (internal/process/next_tick.js:109:7)

Bundling `index.android.js`  99.5% (398/399), failed.


3. 解决办法

  • 删除 node_modules 文件夹: 
    rm -rf node_modules && npm install
  • 重置 packager cache:
    rm -fr $TMPDIR/react-*
    或者:
    node_modules/react-native/packager/packager.sh --reset-cache
  • 清除 watchman watches:
    watchman watch-del-all
  • Recreate the project from scratch:
    react-native run-android


4. 引用

[1] https://github.com/facebook/react-native/issues/4968

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值