watchman--no-pretty get-sockname returned with exit code null

现象:iOS app启动的时特别慢,需要半分钟,在terminal中可以看到watchman的错误信息

1、

ERROR: Unknown option --no-pretty

Watchman:  watchman--no-pretty get-sockname returned with exit code 1 ERROR: Unknown option --no-pretty

ERROR  watchman--no-pretty get-sockname returned with exit code 1 ERROR: Unknown option --no-pretty

Error: watchman--no-pretty get-sockname returned with exit code 1 ERROR: Unknown option --no-pretty

at ChildProcess、(/home/sreejith/projects/sample/node_modules/react-native/node_modules/sane/node_modules/fb-watchman/index.js:194:18)

at emitTwo (events.js:87:13)

at ChildProcess.emit (events.js:172:7)

at maybeClose (internal/child_process.js:817:16)

at Socket.

(internal/child_process.js:319:11)

at emitOne (events.js:77:13)

at Socket.emit (events.js:169:7)

at Pipe._onclose (net.js:469:12)

或者:

2、Watchman:  watchman--no-pretty get-sockname returned with exit code 1  ...... NO such file

....

at ChildProcess ....

at emitTwo ....

.....

解决办法:

npm r -g watchman

brew update && brew upgrade

brew uninstall watchman

brew link pcre

brew install --HEAD watchman

如果遇到权限问题  使用命令 sudo chown -R $(whoami):admin /usr/local

参考:github.com/facebook/react-native/issues/2941

你可能感兴趣的:(watchman--no-pretty get-sockname returned with exit code null)