zoukankan      html  css  js  c++  java
  • React Native 报错:The module `./index.android` could not be found from

    一、问题:

    新建一个工程后,在执行react-native start 后访问:http://localhost:8081/index.android.bundle?platform=android

    报错:

    Error: Unable to resolve module `./index.android` from `D:DevelopToolsReactNativeProjectsFirstProject/.`: The module `./index.android` could not be found from `D:DevelopToolsReactNativeProjectsFirstProject/.`. Indeed, none of these files exist:
      * `D:DevelopToolsReactNativeProjectsFirstProjectindex.android(.native||.android.js|.native.js|.js|.android.json|.native.json|.json|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx)`
      * `D:DevelopToolsReactNativeProjectsFirstProjectindex.androidindex(.native||.android.js|.native.js|.js|.android.json|.native.json|.json|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx)`
        at ModuleResolver.resolveDependency (D:DevelopToolsReactNativeProjectsFirstProject
    ode_modulesmetrosrc
    ode-hasteDependencyGraphModuleResolution.js:163:15)
        at ResolutionRequest.resolveDependency (D:DevelopToolsReactNativeProjectsFirstProject
    ode_modulesmetrosrc
    ode-hasteDependencyGraphResolutionRequest.js:52:18)
        at DependencyGraph.resolveDependency (D:DevelopToolsReactNativeProjectsFirstProject
    ode_modulesmetrosrc
    ode-hasteDependencyGraph.js:283:16)
        at D:DevelopToolsReactNativeProjectsFirstProject
    ode_modulesmetrosrclib	ransformHelpers.js:264:42
        at Server.<anonymous> (D:DevelopToolsReactNativeProjectsFirstProject
    ode_modulesmetrosrcServer.js:1049:41)
        at Generator.next (<anonymous>)
        at asyncGeneratorStep (D:DevelopToolsReactNativeProjectsFirstProject
    ode_modulesmetrosrcServer.js:99:24)
        at _next (D:DevelopToolsReactNativeProjectsFirstProject
    ode_modulesmetrosrcServer.js:119:9)

    二、解决:

    是react native版本更新的一些变动。原来工程中会创建:index.ios.js 和index.android.js,现在只会创建index.js。一个简单的规避方法,就是copy 一份index.js 文件命名为index.android.js即可。

    ##########################################################################################

    扫码加群,共同探讨,共同进步!

  • 相关阅读:
    实用工具---制作试卷
    RDP Client 参数含义调查
    xenserver 虚拟机定时开关机实现
    xenserver 脚本学习之/opt/xensource/bin/xapi-autostart-vms
    最佳的前端监听事件触发方式
    前端之Angularjs
    网页分享
    面试题之事务
    Spring Security安全访问控制解决方案的安全框架
    docker部署
  • 原文地址:https://www.cnblogs.com/51ma/p/11282847.html
Copyright © 2011-2022 走看看