【问题标题】:module does not exist in the haste module map急速模块地图中不存在模块
【发布时间】:2018-10-04 01:47:03
【问题描述】:

我是新来的,希望我输入所有需要的信息。

尝试在我的应用中进行网络抓取时,出现错误

module...does not exist in the haste module map" with 'events' and 'stream'. 

我研究了我的问题,并尝试了以下方向:https://github.com/facebook/react-native/issues/4968,除了守望者步骤,因为我在 Windows 上。 不幸的是,同样的错误不断出现,只是模块不同。这次是它抱怨的 babel。

我该怎么办?

我还尝试制作一个新的 react-native-init 项目,然后 git 克隆我的 src 代码。仍然出现类似的错误。

{
  "name": "Work",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "node node_modules/react-native/local-cli/cli.js start",
    "test": "jest"
  },
  "dependencies": {
    "axios": "^0.18.0",
    "cheerio": "^1.0.0-rc.2",
    "events": "^3.0.0",
    "firebase": "^5.0.3",
    "htmlparser2": "^3.9.2",
    "react": "16.3.1",
    "react-native": "0.55.2",
    "react-native-calendars": "^1.21.0",
    "react-native-communications": "^2.2.1",
    "react-native-fs": "^2.11.17",
    "react-native-router-flux": "^4.0.0-beta.28",
    "react-native-vector-icons": "^5.0.0",
    "react-navigation": "^2.13.0",
    "react-twitter-embedded-timeline": "^0.5.0",
    "react-twitter-widgets": "^1.7.1"
  },
  "devDependencies": {
    "babel-jest": "22.4.3",
    "babel-preset-react-native": "4.0.0",
    "jest": "22.4.3",
    "react-test-renderer": "16.3.1"
  },
  "jest": {
    "preset": "react-native"
  }
}

从节点 cmd 屏幕复制。

【问题讨论】:

  • 仅供参考,有一个用于 windows 的守望者二进制文件。效果出奇的好
  • 值得下载 watchman 只是为了能够遵循一些步骤?
  • 你解决了吗?
  • @MoshFeu 我做了......不幸的是我忘记了如何。我想我重建了
  • 谢谢!我也解决了。问题是eventsv8 中不存在的节点内部模块的一部分,所以我单独安装了这个模块并且它可以工作。

标签: javascript react-native


【解决方案1】:

我的 react-native 应用也遇到了同样的问题。 重置节点缓存为我解决了这个问题:

npm start -- --reset-cache

希望对你有帮助

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-09-24
    • 2023-03-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多