現(xiàn)象: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
如果遇到權(quán)限問題? 使用命令 sudo chown -R $(whoami):admin /usr/local