【问题标题】:How to fix error: code 500 in javascript in react native?如何修复错误:javascript 中的代码 500 反应原生?
【发布时间】:2021-08-14 11:24:22
【问题描述】:

如果有人知道怎么做,请帮我解决这个错误:

Failed building JavaScript bundle.
Unable to resolve module ../Components/View/ReactNativeViewViewConfig from C:\YandexDisk\бизнес\Python\acer_17_inch\tests_react_native\node_modules\react-native\Libraries\Image\ImageViewViewConfig.js: 

None of these files exist:
  * node_modules\react-native\Libraries\Components\View\ReactNativeViewViewConfig(.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)
  * node_modules\react-native\Libraries\Components\View\ReactNativeViewViewConfig\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)
  11 | 'use strict';
  12 | 
> 13 | import ReactNativeViewViewConfig from '../Components/View/ReactNativeViewViewConfig';
     |                                        ^
  14 | import type {ReactNativeBaseComponentViewConfig} from '../Renderer/shims/ReactNativeTypes';
  15 | 
  16 | const ImageViewViewConfig = {

Error Image

【问题讨论】:

  • 你的import语句所在的文件路径是什么?
  • 不是我的导入导致错误。模块“node_modules”导致错误
  • 添加代码,即引发错误的代码。仅通过查看错误日志很难解决问题。但从它的外观来看,import 语句正在引发错误。

标签: javascript react-native


【解决方案1】:

通过使用“expo update”命令更新修复了错误

【讨论】:

    【解决方案2】:

    错误是告诉你哪里出了问题,仔细阅读

    Unable to resolve module ../Components/View/ReactNativeViewViewConfig from C:\YandexDisk\бизнес\Python\acer_17_inch\tests_react_native\node_modules\react-native\Libraries\Image\ImageViewViewConfig.js: 
    

    检查您的导入路径

    【讨论】:

    • 不是我的导入导致错误。模块“node_modules”导致错误
    猜你喜欢
    • 2020-11-14
    • 1970-01-01
    • 2019-01-26
    • 2020-08-07
    • 1970-01-01
    • 2020-09-29
    • 2018-02-03
    • 2019-08-08
    • 2020-10-04
    相关资源
    最近更新 更多