create-react-app 的 npm 测试错误

IT技术 reactjs create-react-app
2021-05-01 22:46:55

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

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

2个回答

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

问题正在发生,因为watchman您的系统上未安装。

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

  1. Watchman使用以下命令安装

    • git 克隆https://github.com/facebook/watchman.git

    • cd守望者/

    • git 结帐 v4.9.0

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

    • ./autogen.sh

    • 。/配置

    • 制作

    • 须藤制作安装

  2. 执行测试

    • 须藤 npm 测试