react-native报错-Unable to resolve module ‘react’
转载 https://blog.csdn.net/mapbar_front/article/details/76165239
error: bundling failed: “Unable to resolve module react
from C:\\Users\\liwd\\Desktop\\mywork\\react-native\\Navigator\\index.android.js
: Module does not exist in the module map\n\nThis might be related to https://github.com/facebook/react-native/issues/4968\nTo resolve try the following:\n
1. Clear watchman watches: watchman watch-del-all
.\n
2.Delete the node_modules
folder: rm -rf node_modules && npm install
.\n
3. Reset packager cache: rm -fr $TMPDIR/react-*
or npm start -- --reset-cache
.”
报错原因:index.android.js 中import 引用的某个 Module 找不到了。
第一种可能性:
解决方案:删除node_modules文件夹,重新加载。或者,打开 node_modules文件夹看一下,是不是文件放别处了,找到后,重新 import。
npm install
- 1
第二种可能性:
react和react-native的版本不匹配
不同的react和react-native版本会冲突,下载指定版本的react和react-native
可行性的做法:
直接选择react-native init之后的react和react-native版本,然后删除node_modules,再进行npm install。
你可能会出现的问题:npm 一个新的如react-native-vector-icons之类的包的时候,最好把node_modules删除,重新npm install。因为这可能发生一些未知的错误。
react-native报错-Unable to resolve module ‘react’相关推荐
- npm安装依赖报错 unable to resolve dependency tree....
场景: 之前的项目组已经没我需求了,我被分配到一个新项目组,重新clone的master代码,在npm install的时候报错unable to resolve dependency tree- 这 ...
- 【8008】解决idea中JDBC写sql语句出现报错Unable to resolve table ‘表名‘?
[8008]解决idea中写sql语句出现报错Unable to resolve table '表名'? 问题背景: 昨天使用JDBC连接数据库中写sql语句,一直爆红,真服了,虽然能运行,但看着不舒 ...
- react native报错:undefined Unable to resolve module 'Dimensions' from 'App.js
在获取屏幕宽度的时候报错, 原代码: 报错信息: 解决方式:
- 报错Unable to resolve target android-5
报错信息:Error:Unable to resolve target android-X(X是一个数字) 错误分析:这种错误一般大部分是SDK 版本不符所造成的,一般会在Ecplise工作空间导入项 ...
- react native报错:Expected a component class,got[object object]
正在写RN的视图部分,突然模拟器报错:Expected a component class,got[object object].找也找不到原因.后来才发现是自己粗心大意造成的. 错误代码: < ...
- react native 报错:cannot read property 'length' of undefined
一.报错信息 根据信息,我们可以看出,这个报错信息和以前JS遇到的报错差不多.应该就是使用'.length'的对象没有定义或者没有值造成的. 二.逐步排错 1.先找到错误代码位置 //这两行代码的意思 ...
- 解决React Native报错:Error:Found unexpected optical bounds (red pixel)
问题背景 同样是在升级 gradle plugin V2.2.3 --> gradle plugin V3.0.1后,运行至打包APK期间报错: Error:found unexpected o ...
- React Native报错undefined is not an object(evaluating ‘_reactnative.propTypes’)解决办法...
原程序是这样写的,然后一直出现错误,找不到PropTypes, import React,{Component } from 'react'; import { View, Text, Image, ...
- php stack trace,【原创】解读React Native报错:Run with --stacktrace option to get the stack trace......
问题背景: 一般我们在编译RN时,如果失败,编译器会在终端抛出如下一段文字: FAILURE: Build failed with an exception. * What went wrong: E ...
最新文章
- 列表组件之RecyclerView
- DevOps和容器:本地or云端,如何选择?
- Zarafa 7.0.11/7.1.2 发布
- Linux系统调用的实现机制分析
- 在网页上启动你的应用程序
- [转载红鱼儿]kbmmw 开发点滴:Authorization failed.
- python反转字符串的元音字母_345. 反转字符串中的元音字母-----leetcode刷题(python解题)...
- [深度学习] 分布式Tensorflow 2.0 介绍(二)
- [密码学基础][每个信息安全博士生应该知道的52件事][Bristol52]42蒙哥马利乘法,哪里泄漏侧信道路吗?
- 福建省高等学校非计算机考试大纲,福建省高等学校计算机应用水平等级考试三级(偏软)考试大纲...
- python训练聊天机器人_一个可以进行训练的聊天机器人,一次chat的源码
- delphi webbrowser 对象不支持_建模初学者,那些你可能还不知道的10个ZBrush小技巧!【值得收藏】...
- SpringBoot 自动装配原理
- centos 7.2 安装php56-xml
- 求数组第二大元素 和 字符串拷贝的实现
- Win32 SDK - 打开文件对话框
- 【Flutter】Dart的类方法和对象操作符
- mysql手册中文版
- UA MATH563 概率论的数学基础 鞅论初步3 条件期望的性质
- java判断日期是当天_Java判断日期为昨天 今天 明天