【问题标题】:npm test error for create-react-appcreate-react-app 的 npm 测试错误
【发布时间】:2017-02-13 11:34:16
【问题描述】:

当我为提供的示例测试的 create-react-app 应用程序运行 npm run test 时遇到此错误。我尝试查找 EMFILE 错误,但我无法理解出了什么问题。

Error: Error watching file for changes: EMFILE at exports._errnoException (util.js:1022:11) at FSEvent.FSWatcher._handle.onchange (fs.js:1406:11)

【问题讨论】:

  • EMFILE 错误意味着您的程序试图打开太多文件。您可以通过在终端中运行 ulimit -n 2048 来增加它可以打开的文件数(在 linux 和 mac 上)
  • 好的。我试着这样做。但是,错误仍然存​​在。

标签: reactjs create-react-app


【解决方案1】:

我遇到了同样的问题,发现 watchman 没有安装。 运行brew install watchman

【讨论】:

    【解决方案2】:

    由于您的系统上未安装watchman,因此出现问题。

    在 Linux 上,您需要执行以下操作

    1. 使用以下命令安装Watchman

      • git clone https://github.com/facebook/watchman.git

      • cd watchman/

      • git checkout v4.9.0

      • sudo apt-get install -y autoconf automake build-essential python-dev libssl-dev libtool

      • ./autogen.sh

      • ./configure

      • 制作

      • sudo make install

    2. 执行测试

      • sudo npm 测试

    【讨论】:

      猜你喜欢
      • 2017-02-18
      • 2021-02-27
      • 2021-04-28
      • 2019-05-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-01-06
      • 1970-01-01
      相关资源
      最近更新 更多