unable to resolve module
来源:互联网 发布:ios网络编程 编辑:程序博客网 时间:2024/05/16 06:59
背景
这个问题是在react native android项目,在适配ios过程中,出现的一个错误。经过不断的调试,最后定位到问题出在项目引用cheerio模块。
尝试解决
出了这个问题,首先想到的是到react native github上去搜索issues。
https://github.com/facebook/react-native/issues/4968
这个issues就是搜索到的,关于‘unable to resolve module’的解决方案。但是,我按照上面很多人提到的各种方案,对我都没有解决。
提示意思是没有找到对应的module,但是,我按着那个路径去查看,文件是存在的。
解决方案
这里的解决方案不是通用的解决方案,只是针对我项目中使用到的cheerio模块。
卸载原来的cheerio模块,重新安装cheerio-without-node-native
然后将原来使用
import Cheerio from 'cheerio';
改为
import Cheerio from 'cheerio-without-node-native';
改完之后,我的问题就解决了。
虽然这不是通用的解决方案,但是,如果你遇到了类似的问题,很大部分是因为模块问题引起的,或者平台不兼容,或者确实缺少文件。
希望可以给你提供个思路方向。
0 0
- unable to resolve module
- Unable to resolve module `react/lib/ReactComponentWithPureRenderMixin`
- error: bundling: UnableToResolveError: Unable to resolve module `react/lib/ReactDebugCurrentFrame`
- react-native报错-Unable to resolve module ‘react’
- Unable to resolve module `react-native/Libraries/EventEmitter/EventEmitter`
- Unable to resolve target
- Unable to resolve target
- Unable to resolve host
- React-Native_学习笔记1: Unable to resolve module Dimensions from “...js” Invalid directory /Users/node_m
- React native 常见错误:unable to resolve module react-native-scrollable-tab-view
- unable to resolve ... for transcoding
- fsck.ext3:Unable to resolve
- fsck.ext3:unable to resolve
- Unable to resolve superclass of ***
- sudo: unable to resolve host ****
- Unable to resolve target 'android
- unable to resolve target “android_8”
- unable to resolve host address
- HTTPS自建证书
- 在Android studio中如何处理.9图片
- C#.NET网络程序开发的基本类(一)(C#---网络编程)
- Ubuntu 使用 su 切换用户时提示 Authentication failure 解决方法
- 如何用文件对比工具自动缩放对比图片
- unable to resolve module
- windows下创建线程编程
- 进制之间的转换(java代码实现)
- RobotFramework打不开谷歌浏览器问题
- C++中多态怎样由虚函数实现。和纯虚函数介绍
- 图像检索服务器编写问题记录——服务器端模型再思考
- [LeetCode]75. Sort Colors
- Linux下安装MySQL
- Oracle 列转行函数 Listagg()