`

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 文件夹: 
    [plain] view plain copy
     
    1. rm -rf node_modules && npm install  
  • 重置 packager cache:
    [plain] view plain copy
     
    1. rm -fr $TMPDIR/react-*  
    或者:
    [plain] view plain copy
     
    1. node_modules/react-native/packager/packager.sh --reset-cache  
  • 清除 watchman watches:
    [plain] view plain copy
     
    1. watchman watch-del-all  
  • Recreate the project from scratch:
    [plain] view plain copy
     
    1. react-native run-android  

 

 

分享到:
评论

相关推荐

    react-native-relay, 响应本机和中继工作.zip

    react-native-relay, 响应本机和中继工作 注释问题已经解决了,请不要再使用这个项目了。 谢谢。 react-native-relay 带中继的本机响应版本...按照 https://github.com/facebook/relay/issues/26 中所述修复兼容性问题

    react-native boost 依赖 2019.zip

    React-Native是由Facebook开发的一个开源框架,允许开发者使用JavaScript和React来构建原生移动应用。它采用“Learn once, write anywhere”的理念,让开发者能够用一套代码同时开发iOS和Android应用。然而,由于...

    基于 React-Native 实现的 GitHub 客户端,很漂亮哦~.zip

    React-Native 是一个由 Facebook 开发的开源框架,它允许开发者使用 JavaScript 和 React 框架来构建原生的移动应用程序。这个项目标题表明我们正在处理一个基于 React-Native 的 GitHub 客户端应用,而描述中的“很...

    react-native-demo:使用来自GitHub API的数据显示问题列表

    在这个案例中,开发者可能使用了fetch函数或者axios模块与GitHub API进行交互,发送GET请求到特定的URL(如`https://api.github.com/repos/:owner/:repo/issues`),替换`:owner`和`:repo`为实际的用户和仓库名。...

    av-react-native

    React Native是由Facebook开发的开源库,它允许开发者使用JavaScript和React来构建原生的iOS和Android应用。 【描述】"React本地培训:基本仓库" 暗示这个项目是围绕React Native的基本概念和实践进行的,作为一个...

    minimgur:(未维护)用React Native编写的最小的Imgur匿名图像上传器

    1. **React Native**: React Native是一个开源框架,由Facebook开发,允许使用JavaScript和React组件化思想来构建原生移动应用程序。在minimgur项目中,开发者使用React Native创建了一个用户界面,可以与Android...

Global site tag (gtag.js) - Google Analytics