jest --watch (npm t — --watch) throwing errors

浪尽此生 提交于 2019-12-11 06:13:27

问题


node[1265] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-22)

This happens when running npm t -- --watch. On my system node v7.4.0 it works fine. On my fellow coworker (node v7.9) it fails.

This question here asks the exact problem:

Testing with Jest failed with Error: Error watching file for changes: EMFILE


However the fix "install watchman" didn't work.

We did brew install watchman then brew postinstall watchman

Then when trying to run npm t -- --watch again we get a new error:

/Users/user/Library/LaunchAgents/com.github.facebook.watchman.plist: Operation not permitted

Anyone else running into a problem with jest watch?

The regular npm t will work.


回答1:


After installing watchman, you can give it a full permission to the launch agents by sudo chown -R $(whoami):staff ~/Library/LaunchAgents.
It will resolve the permission issue.




回答2:


So we had to install jest-cli with watchman on his computer...



来源:https://stackoverflow.com/questions/44596052/jest-watch-npm-t-watch-throwing-errors

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!