简体   繁体   English

React Native 寻找错误的文件夹并抛出“无法解析模块。 这些文件都不存在”错误

[英]React Native seeks wrong folder and throws “Unable to resolve module. None of these files exist” error

There is a framework which is intended to make React Native to work in Linux desktop.有一个框架旨在使 React Native 在 Linux 桌面上工作。
I forked it to my repo , since original author recently stopped managed it.我将它分叉到我的仓库,因为原作者最近停止管理它。
They were still using React Native 0.60.6, so I upgraded it to 0.63.4.他们仍在使用 React Native 0.60.6,所以我将它升级到 0.63.4。

But when I ran react-native run-linux command, The window became red, and said Failed to load source code .但是当我运行react-native run-linux命令时, window 变红了,说Failed to load source code
And this is what terminal said:这就是终端所说的:

error: Error: Unable to resolve module ./Libraries/Components/AccessibilityInfo/AccessibilityInfo from /home/myname/Desktop/foo/node_modules/react-native/index.js: 

None of these files exist:
  * node_modules/react-native/Libraries/Components/AccessibilityInfo/AccessibilityInfo(.native|.desktop-qt.js|.native.js|.js|.desktop-qt.json|.native.json|.json|.desktop-qt.ts|.native.ts|.ts|.desktop-qt.tsx|.native.tsx|.tsx)
  * node_modules/react-native/Libraries/Components/AccessibilityInfo/AccessibilityInfo/index(.native|.desktop-qt.js|.native.js|.js|.desktop-qt.json|.native.json|.json|.desktop-qt.ts|.native.ts|.ts|.desktop-qt.tsx|.native.tsx|.tsx)
  11 | 'use strict';
  12 |
> 13 | import typeof AccessibilityInfo from './Libraries/Components/AccessibilityInfo/AccessibilityInfo';
     |                                       ^
  14 | import typeof ActivityIndicator from './Libraries/Components/ActivityIndicator/ActivityIndicator';
  15 | import typeof Button from './Libraries/Components/Button';
  16 | import typeof CheckBox from './Libraries/Components/CheckBox/CheckBox';
    at ModuleResolver.resolveDependency (/home/myname/Desktop/foo/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:168:15)
    at DependencyGraph.resolveDependency (/home/myname/Desktop/foo/node_modules/metro/src/node-haste/DependencyGraph.js:353:43)
    at Object.resolve (/home/myname/Desktop/foo/node_modules/metro/src/lib/transformHelpers.js:271:42)
    at resolve (/home/myname/Desktop/foo/node_modules/metro/src/DeltaBundler/traverseDependencies.js:571:33)
    at /home/myname/Desktop/foo/node_modules/metro/src/DeltaBundler/traverseDependencies.js:587:26
    at Array.reduce (<anonymous>)
    at resolveDependencies (/home/myname/Desktop/foo/node_modules/metro/src/DeltaBundler/traverseDependencies.js:586:33)
    at /home/myname/Desktop/foo/node_modules/metro/src/DeltaBundler/traverseDependencies.js:275:33
    at Generator.next (<anonymous>)
    at asyncGeneratorStep (/home/myname/Desktop/foo/node_modules/metro/src/DeltaBundler/traverseDependencies.js:87:24)

The strangest thing of that error message is, React Native is looking for module in node_modules/react-native/ .该错误消息中最奇怪的是,React Native 正在node_modules/react-native/中寻找模块。
modules which ends with .desktop-qt.js are placed in node_modules/react-native-linux/ ..desktop-qt.js结尾的模块放在node_modules/react-native-linux/中。

So, the cause of error must be seeking modules in wrong folder.因此,错误的原因必须是在错误的文件夹中寻找模块。 how can I fix this?我怎样才能解决这个问题?

I revoked to 0.60.6 and it solved.我撤销到 0.60.6 并解决了。 Maybe updating script was a problem.也许更新脚本是个问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 React Native:无法解析模块。 这些文件都不存在: - React Native: Unable to resolve module. None of these file exist: React Native: Unabe to resolve module./src/Home from..../这些文件都不存在: - React Native: Unabe to resolve module ./src/Home from.... / None of these files exist: 无法在本机反应中导入 svg:这些文件都不存在 - unable to import svg in react native : None of these files exist 语法错误这些文件都不存在:REACT NATIVE CLI - Syntax Error None of these files exist: REACT NATIVE CLI react-native 如何解决“无法解析模块...”错误? - How to solve "Unable to resolve module..." error with react-native? 错误“无法解析模块 aws-amplify-react-native” - Error "Unable to resolve module aws-amplify-react-native" 无法从模块中解析模块`。/ index.android`。实际上,以下文件均不存在: - Unable to resolve module `./index.android` from The module `./index.android` could not be found from Indeed, none of these files exist: React Native TypeScript:无法解析模块(但它存在) - React Native TypeScript: Unable to resolve module (but it exists) 无法解析模块`scheduler/tracing` react native - Unable to resolve module `scheduler/tracing` react native 反应本地映像“无法解析模块” - React native image “Unable to resolve module”
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM