“模块映射或这些目录中不存在模块"在反应原生 [英] "Module does not exist in the module map or in these directories" in react native

查看:49
本文介绍了“模块映射或这些目录中不存在模块"在反应原生的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经开始学习 React Native.在 index.android.js 中导入新的 js [example Home.js] 时,我在简单的 React Native 项目中苦苦挣扎我收到以下错误"

I have started learning react native. I am struggling in the simple react native project while importing new js [example Home.js] in index.android.js I'm getting the following error"

模块映射或这些目录中不存在模块.

Module does not exist in the module map or in these directories.

UnableToResolveError: Unable to resolve module .src/Components/home/Home/Home.js from C:\Users\Magi\Dictionary1\index.android.js:模块在模块映射或这些目录中不存在:

UnableToResolveError: Unable to resolve module .src/Components/home/Home/Home.js from C:\Users\Magi\Dictionary1\index.android.js: Module does not exist in the module map or in these directories:

import React, { Component } from 'react';    
import {
  AppRegistry,
  StyleSheet,
  Text,
  View
} from 'react-native';    
import Home from '.src/Components/home/Home/Home.js';

推荐答案

一些不需要的导入可能会导致问题.

Some unwanted import can be causing the issue.

对我来说,这种状态造成了问题.

For me, this state was creating the issue.

import { exec } from "child_process";

这篇关于“模块映射或这些目录中不存在模块"在反应原生的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆