当前位置: 首页 > 工具软件 > ionicons > 使用案例 >

error: bundling failed: Error: While resolving module `react-native-vector-icons/Ionicons`

羊舌承颜
2023-12-01
error: bundling failed: Error: While resolving module `react-native-vector-icons/Ionicons`, the Haste package `react-native-vector-icons` was found. However the module `Ionicons` could not be found within the package. Indeed, none of these files exist:

  * `E:\Workspaces\RnWorkspaces\myapp\node_modules\react-native\local-cli\core\__fixtures__\files\Ionicons(.native||.android.js|.native.js|.js|.android.json|.native.json|.json)`
  * `E:\Workspaces\RnWorkspaces\myapp\node_modules\react-native\local-cli\core\__fixtures__\files\Ionicons\index(.native||.android.js|.native.js|.js|.android.json|.native.json|.json)`
    at resolveHasteName (E:\Workspaces\RnWorkspaces\myapp\node_modules\metro\src\node-haste\DependencyGraph\ModuleResolution.js:385:9)
    at ModuleResolver._resolveDependency (E:\Workspaces\RnWorkspaces\myapp\node_modules\metro\src\node-haste\DependencyGraph\ModuleResolution.js:315:37)
    at ModuleResolver.resolveDependency (E:\Workspaces\RnWorkspaces\myapp\node_modules\metro\src\node-haste\DependencyGraph\ModuleResolution.js:311:877)
    at ResolutionRequest.resolveDependency (E:\Workspaces\RnWorkspaces\myapp\node_modules\metro\src\node-haste\DependencyGraph\ResolutionRequest.js:96:16)
    at DependencyGraph.resolveDependency (E:\Workspaces\RnWorkspaces\myapp\node_modules\metro\src\node-haste\DependencyGraph.js:269:4352)
    at E:\Workspaces\RnWorkspaces\myapp\node_modules\metro\src\DeltaBundler\traverseDependencies.js:201:36
    at Generator.next (<anonymous>)
    at step (E:\Workspaces\RnWorkspaces\myapp\node_modules\metro\src\DeltaBundler\traverseDependencies.js:256:306)
    at E:\Workspaces\RnWorkspaces\myapp\node_modules\metro\src\DeltaBundler\traverseDependencies.js:256:536
    at new Promise (<anonymous>)

出现上述错误参照:参照博文1 参照博文2

解决方式:

    删除:..\node_modules\react-native\local-cli\core\__fixtures__\files\package.json文件(删除前先备份)。


 类似资料: