【问题标题】:UnableToResolveError: Unable to resolve module `util`UnableToResolveError:无法解析模块`util`
【发布时间】:2017-09-22 16:02:55
【问题描述】:

我在我的 react native 项目中使用 xml2json,在运行应用程序时,我收到错误消息

UnableToResolveError: Unable to resolve module `events`
This might be related to https://github.com/facebook/react-native/issues/4968
To resolve try the following:
  1. Clear watchman watches: `watchman watch-del-all`.
  2. Delete the `node_modules` folder: `rm -rf node_modules && npm install`.
  3. Reset packager cache: `rm -fr $TMPDIR/react-*` or `npm start --reset-cache`.

在其他第三方模块中也出现过,都是nodejs核心模块,无法解析。 需要你的帮助,谢谢 :)

【问题讨论】:

  • 不肯定你能做到这一点,Node Core 库最终依赖于 V8 和移动设备上不存在的 C 实现,所以据我所知,你不能像那样将它们捆绑在一起。
  • 同样的问题((有什么消息吗?

标签: node.js reactjs npm react-native npm-install


【解决方案1】:

消息显示依赖项中不存在指定的模块。我修复它的方法是重新安装错误消息指定的模块包。

在你的情况下 npm install --save util

希望这会有所帮助!

【讨论】:

    猜你喜欢
    • 2022-12-05
    • 2017-09-29
    • 2017-11-12
    • 2022-11-10
    • 2021-04-15
    • 2023-04-11
    • 1970-01-01
    • 2017-12-11
    • 2014-03-14
    相关资源
    最近更新 更多