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
- yarn start OR yarn start --reset-cache
- 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
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…
You are a lifesaver man. Thanks alot!!
yeah, It might be some import from -> ‘@babel/core’;
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.right bro…
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"