npm test 报错
来源:5-3 React 测试工具简介
qq_下弦月_4
2019-03-13
我下载代码后,安装依赖 npm install, 然后npm run dev 都正常
但是 运行 npm test 报错,麻烦老师看下
RUNS src/containers/__test__/Create.test.js
RUNS src/components/__test__/PriceForm.test.js
RUNS src/App.test.js
RUNS src/containers/__test__/Home.test.js
RUNS src/components/__test__/MonthPicker.test.js
RUNS src/components/__test__/CategorySelect.test.js
Test Suites: 0 of 9 total
Tests: 0 total
Snapshots: 0 total
Time: 0s2019-03-13 10:48 node[70606] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-22)
2019-03-13 10:48 node[70606] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-22)
events.js:193
throw er; // Unhandled 'error' event
^
Error: Error watching file for changes: EMFILE
at _errnoException (util.js:1031:13)
at FSEvent.FSWatcher._handle.onchange (fs.js:1374:9)
npm ERR! Test failed. See above for more details.
写回答
1回答
-
你好 请告知一下你的 node 版本 操作系统,如果是 MacOs Sierra 的话 我找到了解决方案,在这里 https://github.com/facebook/create-react-app/issues/871 基本就是安装 watchman
sudo chown -R $(whoami) /usr/local brew update brew install watchman
122020-04-10
相似问题