react-native 错误总结

The development server returned response error code: 500 in react-native

https://blog.csdn.net/qingsong_xu/article/details/72515075

写ReactNative应用时遇到:The development server returned response error code: 500,经查看是由于某个modules不在modules map里,多次关闭terminal及模拟器均未解决,最后根据错误提示,三行代码解决。

按顺序在命令行里执行一下下面的指令,运行过程中未报错,基本就ok了,嘿嘿

1、watchman watch-del-all

2、rm -rf node_modules && npm install

3、rm -fr $TMPDIR/react-*

若还是未能解决,则应该仔细看看错误提示是什么了。

我的提示是Moduel does not exist in module map or in these direactories.

说白了就是找不到module,然而我的确是import了这个module,最后仔细查看了目录结构:

我是从index.android.js中默认首页为FirstPage。在index.android.js的相对路径是‘./pages/FirstPage’

在index.android.js importe FirstPage时,必须是相对路径,才能成功!!绝对路径还是会报同样的错!有点小坑

另外,练习Navigator时,必须安装一下“过时的自定义组件”,否则无法正常使用。

npm install --save react-native-deprecated-custom-components

react错误总结的更多相关文章

  1. React错误总结解决方案(二)

    1.React native: Cannot add a child that doesn't have a YogaNode or parent node 该错误一般是因为render方法中注释语句 ...

  2. React 错误处理(componentDidCatch)

    前言 看react 文档突然发现有这个 错误处理函数,好像是17年9月出的,这个真的绝了可以帮助我们捕捉错误咯 React 16 将提供一个内置函数 componentDidCatch,如果 rend ...

  3. React 错误边界组件

    这是React16的内容,并不是最新的技术,但是用很少被讨论,直到通过文档发现其实也是很有用的一部分内容,还是总结一下- React中的未捕获的 JS 错误会导致整个应用的崩溃,和整个组件树的卸载.从 ...

  4. webpack react 错误整理

    1.ERROR in ./src/entry.js Module build failed: SyntaxError 解决方法: 安装babel-preset-react,  npm install ...

  5. React错误总结(三)

    神坑react native之Cannot Add a child that doesn't have a YogaNode to a parent with out a measure functi ...

  6. 一个自己犯的react错误

    在看<react小书>高阶组件一节的时候,看到如下代码 import React, { Component } from 'react' export default (WrappedCo ...

  7. React错误收集

    1.  Uncaught Error: Element type is invalid: expected a string (for built-in components) or a class/ ...

  8. react 错误处理

    https://www.jianshu.com/p/61d09e488743 https://codepen.io/sgroff04/pen/dVbgJy/

  9. 《React设计模式与最佳实践》笔记

    书里的demo都是15.3.2以下版本的,有些demo用最新的react 16.x版本会报错,安装包的时候记得改一下版本   第一章 React 基础 命令式编程描述代码如何工作,而声明式编程则表明想 ...

随机推荐

  1. mac启动springboot失败,8080端口被占用,mac命令行关闭端口

    如下图,idea启动springboot失败,8080端口被占用 Error starting ApplicationContext. To display the conditions report ...

  2. 菜鸟笔记 -- Chapter 4.7 代码注释与编码规范

    4.7 代码注释与编码规范 在程序代码中适当的添加注释可以提高程序的可读性和可维护性.好的编码规范可以使程序更易阅读和理解.下面我们将介绍几种代码注释,以及应该注意的编码规范. 4.7.1 代码注释 ...

  3. Jensen 不等式

    若f(x)为区间I上的下凸(上凸)函数,则对于任意xi∈I和满足∑λi=1的λi>0(i=1,2,...,n),成立: \[f(\sum ^{n} _{i=1} \lambda _{i}x_{i ...

  4. substr在oracle和mysql中的应用和区别

    Oracle: 书写格式: (1)Select  substr(字段名(string) , 起始位置(int) , 截取长度(int)) 示例: selectsubstr('123456',0,3)a ...

  5. docker安装MySQL 8.0及初始化错误处理

      Preface          Several days ago,I've implement a docker environmnet,I'm gonna Install a MySQL 8. ...

  6. This system is registered to Red Hat Subscription Management, but is not receiving updates. You can use subscription-manager to assign subscriptions.

    Wrong date and time, reset the date and time in the system properly. It may also happen that system ...

  7. loushang框架的开发中关于BSP的使用,将写好的功能模块部署到主页界面结构上

    前言: 当我们已经开发好相应的模块或者功能的时候,需要将这个功能部署在index主页上作为可点击直接使用的模块,而不是每次需要去浏览对应的url地址. 这时候就需要运用到L5的BSP. 作为刚刚入门l ...

  8. Hadoop参数调优

    转自:http://blog.sina.com.cn/s/blog_6a67b5c50100vop9.html dfs.block.size 决定HDFS文件block数量的多少(文件个数),它会间接 ...

  9. CPS---(Cyber-Physical Sytem,信息物理融合系统)

    1.CPS定义 CPS是连接计算机虚拟世界与物理现实世界的系统.---We refer to systems that bridge the cyber-world of computing and ...

  10. python中协程实现的本质以及两个封装协程模块greenle、gevent

    协程 协程,又称微线程,纤程.英文名Coroutine. 协程是啥 协程是python个中另外一种实现多任务的方式,只不过比线程更小占用更小执行单元(理解为需要的资源). 为啥说它是一个执行单元,因为 ...