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

2019-07-31 09:44发布

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.

2条回答
Melony?
2楼-- · 2019-07-31 10:21

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.

查看更多
爷、活的狠高调
3楼-- · 2019-07-31 10:24

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

查看更多
登录 后发表回答