在解析模块`react-native/Libraries/Core/Devtools/getDevServer`时,发现了Haste包`react-native`

Posted

技术标签:

【中文标题】在解析模块`react-native/Libraries/Core/Devtools/getDevServer`时,发现了Haste包`react-native`【英文标题】:While resolving module `react-native/Libraries/Core/Devtools/getDevServer`, the Haste package `react-native` was found 【发布时间】:2022-01-11 18:43:32 【问题描述】:

构建 javascript 包:错误 错误 20:56 在解析模块react-native/Libraries/Core/Devtools/getDevServer 时,发现了Haste 包react-native。但是在包中找不到模块Libraries/Core/Devtools/getDevServer。事实上,这些文件都不存在:

C:\Users\User\Desktop\repos\native\react-native\Libraries\Core\Devtools\getDevServer(.native|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx|.android.js|.native.js|.js|.android.jsx|.native.jsx|.jsx|.android.json|.native.json|.json) C:\Users\User\Desktop\repos\native\react-native\Libraries\Core\Devtools\getDevServer\index(.native|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx|.android.js|.native.js|.js|.android.jsx|.native.jsx|.jsx|.android.json|.native.json|.json) 信息 20:57 构建 JavaScript 包

【问题讨论】:

请澄清您的具体问题或提供其他详细信息以准确突出您的需求。正如目前所写的那样,很难准确地说出你在问什么。 【参考方案1】:

好的,从昨天开始我也一直在处理这个问题。 我做了以下步骤来修复它:

使用 nvm,切换到最新的 LTS Node 版本 删除了 node_modulesyarn.lockpackage-lock.json.expo 文件夹 正在运行 yarnnpm cache clean 重新安装依赖项

如果这一切都失败了,请尝试通过运行重新创建您的项目

expo init app-name

注意:您必须仔细检查您当前使用的expo-cli 版本是否与 React Native 匹配;你可以查看here。

【讨论】:

以上是关于在解析模块`react-native/Libraries/Core/Devtools/getDevServer`时,发现了Haste包`react-native`的主要内容,如果未能解决你的问题,请参考以下文章

MyBatis源码解析 - 解析器模块

Python 解析模块 异常模块 响应模块 序列化和反序列化组件

Maven 无法解析同一多模块项目中模块的依赖关系

Python 命令行参数解析: optparse 模块

解析模块

在 src/app 外部定义的模块显示错误“找不到模块:错误:无法解析 './' in”