无法解析 empty-module.js react-native 和 metro-cli

Unable to resolve empty-module.js react-native and metro-cli

我已经从 windows 开发环境切换到 linux 环境,但我无法让 react-native 应用程序再次运行。该应用程序使用 gradle 构建并通过 adb 完美地安装到 phone 上,当我通过 metro (npx react-native start) 发送应用程序构建时,我得到以下回吐。该包存在...所以我不明白它是如何找不到的。我不明白的是为什么 from /home/hovaness/Public/ignitefolderscan/_ returns 一开始不是真正的目录...

错误

错误:错误:无法从 /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:无法在项目或这些目录中找到 /home/hovaness/Public/ignitefolderscan/node_modules/@react-native-community/cli-plugin-metro/node_modules/metro-runtime/src/modules/empty-module.jsnode_modules

Ignite-cli 医生

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

运行 npm audit fix --force 最终将软件包升级到彼此不兼容的版本,从而导致此错误。不要盲目运行这个