'Unable to resolve empty-module.js react-native and metro-cli
I've switched over from a windows dev environment to a linux environment and I'm having trouble getting react-native app going again. The application builds with gradle and installs onto the phone through adb
perfectly, when I send the app build through metro (npx react-native start
) I get the following spit back. The package exists... so I don't understand how its not found. I thing I don't understand is why from /home/hovaness/Public/ignitefolderscan/_
returns when its not a realy directory in the first place...
Error
error: Error: Unable to resolve module /home/hovaness/Public/ignitefolderscan/node_modules/@react-native-community/cli-plugin-metro/node_modules/metro-runtime/src/modules/empty-module.js
from /home/hovaness/Public/ignitefolderscan/_
: /home/hovaness/Public/ignitefolderscan/node_modules/@react-native-community/cli-plugin-metro/node_modules/metro-runtime/src/modules/empty-module.js
could not be found within the project or in these directories:
node_modules
Ignite-cli doctor
System
platform linux
arch x64
cpu 20 cores Intel(R) Core(TM) i9-10900X CPU @ 3.70GHz
directory ignitefolderscan /home/hovaness/Public/ignitefolderscan
JavaScript (and globally-installed packages)
node 16.14.2 /bin/node
npm 8.7.0 /home/hovaness/Public/ignitefolderscan/node_modules/.bin/npm
@react-native-community/cli 7.0.3
corepack 0.10.0
expo 44.0.6
jetifier 2.0.0
n 8.1.0
npm 8.7.0
npx 10.2.2
pnpm 7.0.0-rc.6
react-native-cli 2.0.1
yarn 1.22.18
yarn 1.22.18 /bin/yarn
pnpm 7.0.0-rc.6 /bin/pnpm
<no pnpm global package info available>
Ignite
ignite-cli 7.10.8 /home/hovaness/.npm/_npx/e31027f3785124a8/node_modules/.bin/ignite
ignite src build /home/hovaness/.npm/_npx/e31027f3785124a8/node_modules/ignite-cli/build
Android
java 11.0.14.1 /bin/java
android home - undefined
Solution 1:[1]
Running npm audit fix --force
ended up upgrading the packages to versions that were not compatible with each other creating this error. Don't blindly run this.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 |