react-native: Unable to resolve module `path` from `node_modules\@babel\core\lib\config\item.js`: path could not be fou nd within the project.

Please provide all the information requested. Issues that do not follow this format are likely to stall.

Description

The app throws an error Unable to resolve module `path` from `node_modules\@babel\core\lib\config\item.js`: path could not be found within the project. Yesterday it was working fine, and the only thing I changed since then is a .js file that just used react-native and redux and that has nothing to do with babel and not being able to find a Node.js module. I am aware of other GitHub issues that have been closed in the past, but the solution they suggest is changing a file inside of the @babel/core package and removing a line from it. Personally I am not comfortable with such brute-force solutions and would much prefer a real solution

React Native version:

System: OS: Windows 10 10.0.18363 CPU: (8) x64 AMD Ryzen 7 3700U with Radeon Vega Mobile Gfx Memory: 3.61 GB / 9.95 GB Binaries: Node: 13.12.0 - ~\AppData\Local\Temp\yarn–1586872969866-0.7712209224294915\node.CMD Yarn: 1.22.4 - ~\AppData\Local\Temp\yarn–1586872969866-0.7712209224294915\yarn.CMD npm: 6.14.4 - C:\Program Files\nodejs\npm.CMD Watchman: Not Found SDKs: Android SDK: Not Found IDEs: Android Studio: Version 3.6.0.0 AI-192.7142.36.36.6241897 Languages: Java: Not Found Python: 2.7.17 - C:\Python27\python.EXE npmPackages: @react-native-community/cli: Not Found react: 16.11.0 => 16.11.0 react-native: ^0.62.2 => 0.62.2 npmGlobalPackages: react-native: Not Found

Steps To Reproduce

  1. yarn start OR yarn start --reset-cache
  2. Launching the app on my phone

Expected Results

The app should work normally, especially given the fact that the only change I made since the last working state was changing a .js file that just used react-native and redux

Snack, code example, screenshot, or link to a repository:

Please provide a Snack (https://snack.expo.io/), a link to a repository on GitHub, or provide a minimal code example that reproduces the problem. You may provide a screenshot of the application if you think it is relevant to your bug report. Here are some tips for providing a minimal example: https://stackoverflow.com/help/mcve

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 15

Most upvoted comments

import { resolvePlugin } from ‘@babel/core’; check your .js file you may have accidentally imported this just remove that and you will be okay to go.

import { resolvePlugin } from ‘@babel/core’; check your .js file you may have accidentally imported this just remove that and you will be okay to go.

In my case, it was import { types } from ‘@babel/core’ Thank you alot!!!

@nharis7 Yeap it was exactly that. Thank you IntelliSense…

import { resolvePlugin } from ‘@babel/core’; check your .js file you may have accidentally imported this just remove that and you will be okay to go.

You are a lifesaver man. Thanks alot!!

yeah, It might be some import from -> ‘@babel/core’;

import { resolvePlugin } from ‘@babel/core’; check your .js file you may have accidentally imported this just remove that and you will be okay to go.

Thank you, thank you, thank you! VS Code had added that line at the top of my file (unbidden) when it auto-completed resolve (also unbidden). I then spent the next 10 minutes trying to work out why it had all suddenly broken.

import { resolvePlugin } from ‘@babel/core’; check your .js file you may have accidentally imported this just remove that and you will be okay to go.

right bro…

I have the very same problem… the difference is that i have no @babel import at all … below is how my App.js looks like import { StatusBar } from "expo-status-bar"; import React, { useEffect } from "react"; import { NavigationContainer, DarkTheme as NavigationDarkTheme, DefaultTheme as NavigationDefaultTheme, } from "@react-navigation/native"; import AsyncStorage from "@react-native-community/async-storage"; import * as SplashScreen from "expo-splash-screen"; import { createDrawerNavigator } from "@react-navigation/drawer"; import { createStackNavigator } from "@react-navigation/stack"; import RootStackScreen from "./app/screens/RootStackScreen"; import Icon from "react-native-vector-icons/Ionicons"; import { ActivityIndicator, View } from "react-native"; import { Provider as PaperProvider, DarkTheme as PaperDarkTheme, DefaultTheme as PaperDefaultTheme, } from "react-native-paper"; import { AuthContext } from "./app/components/context"; import { keep, find, del } from "./app/utils/storage"; import conf from "./app/config/configs"; import colors from "./app/config/colors"; import MainTabScreen from "./app/screens/MainTabScreen"; import DrawerContentScreen from "./app/screens/DrawerContentScreen"; import CorpDrawerContentScreen from "./app/screens/CorpDrawerContentScreen"; import SupportScreen from "./app/screens/SupportScreen"; import AboutScreen from "./app/screens/AboutScreen"; import SubjectTopicsScreen from "./app/screens/SubjectTopicsScreen"; import TopicLessonsScreen from "./app/screens/TopicLessonsScreen"; import PackagesScreen from "./app/screens/PackagesScreen"; import OrderPaymentScreen from "./app/screens/OrderPaymentScreen"; // corp screens import CorpMainTabScreen from "./app/screens/CorpMainTabScreen"; import CorpAboutScreen from "./app/screens/CorpAboutScreen"; import CorpSupportScreen from "./app/screens/CorpSupportScreen";

What error are you getting ? Show that error here

I solved it. Searched all the imported screens for @babel and found below… which i commented out and it worked import { loadOptions } from "@babel/core"