React Native踩坑笔记(持续更新中...)

       最近发现市场上对React Native开发人员的需求挺多的,自己就想学习一下React Native,多一门技术,好将来买个好价位。嘿嘿!

       在学习React Native中碰到了不少坑,再次记录下来以备自己以后查阅,当然了,也会持续更新。

        只写学习中碰到的问题。至于安装请移步:搭建开发环境,我安装的是React Native0.44

本人使用的是Ubuntu16.04操作系统,按上面链接中的安装教程安装的,安装过程挺顺利的。没有碰到什么棘手的问题。但是安装成功后,创建项目运行是出问题了。

1.error calling appregistry.run application

按教程,cd到目录下,运行:react-nativerun-android,但是运行效果手机一片红,如下:

原因:是没有启动服务器端。

答:在Android手机测试之前,要   一定要先

启动JS服务器端,执行命令:

react-native start

命令执行结果:


上面的问题就解决了。

2.This warning is caused by a @providesModule declaration with the same name across two different files

运行react-native start 开始服务器,报一下错误。

This warning is caused by a @providesModule declaration with the same name across two different files.jest-haste-map: @providesModule naming collision:  Duplicate module name: bser  Paths: /home/yaoyongchao/Ab/node_modules/react-native/node_modules/bser/package.json collides with /home/yaoyongchao/Ab/node_modules/react-native/node_modules/jest-haste-map/node_modules/bser/package.jsonThis warning is caused by a @providesModule declaration with the same name across two different files. ERROR  A non-recoverable condition has triggered.  Watchman needs your help!The triggering condition was at timestamp=1494859938: inotify-add-watch(/home/yaoyongchao/YouDemo/node_modules/fbjs/node_modules/core-js/library/fn/number) -> The user limit on the total number of inotify watches was reached; increase the fs.inotify.max_user_watches sysctlAll requests will continue to fail with this message until you resolvethe underlying problem.  You will find more information on fixing this athttps://facebook.github.io/watchman/docs/troubleshooting.html#poison-inotify-add-watch{"watchmanResponse":{"version":"4.7.0","error":"A non-recoverable condition has triggered.  Watchman needs your help!\nThe triggering condition was at timestamp=1494859938: inotify-add-watch(/home/yaoyongchao/YouDemo/node_modules/fbjs/node_modules/core-js/library/fn/number) -> The user limit on the total number of inotify watches was reached; increase the fs.inotify.max_user_watches sysctl\nAll requests will continue to fail with this message until you resolve\nthe underlying problem.  You will find more information on fixing this at\nhttps://facebook.github.io/watchman/docs/troubleshooting.html#poison-inotify-add-watch\n"}}Error: A non-recoverable condition has triggered.  Watchman needs your help!The triggering condition was at timestamp=1494859938: inotify-add-watch(/home/yaoyongchao/YouDemo/node_modules/fbjs/node_modules/core-js/library/fn/number) -> The user limit on the total number of inotify watches was reached; increase the fs.inotify.max_user_watches sysctlAll requests will continue to fail with this message until you resolvethe underlying problem.  You will find more information on fixing this athttps://facebook.github.io/watchman/docs/troubleshooting.html#poison-inotify-add-watch    at ChildProcess.(/home/yaoyongchao/Ab/node_modules/react-native/node_modules/jest-haste-map/node_modules/sane/node_modules/fb-watchman/index.js:207:21)    at emitTwo (events.js:106:13)    at ChildProcess.emit (events.js:191:7)    at maybeClose (internal/child_process.js:886:16)    at Socket.(internal/child_process.js:342:11)

at emitOne (events.js:96:13)

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

at Pipe._handle.close [as _onclose] (net.js:497:12)

解决:watchman watch-del-all

rm -rf node_modules && npm install

rm -fr $TMPDIR/react-*

npm cache clean

npm start -- --reset-cache

解决方案来自:https://medium.com/@jeanjacquesbagui/react-native-providesmodule-naming-collision-error-6bc090925fb3

3.import React, { Component } from 'react';

SyntaxError: Unexpected token import

WebStorm运行react native代码时 报如下错误:

import React, { Component } from 'react';

SyntaxError: Unexpected token import

at createScript (vm.js:56:10)

at Object.runInThisContext (vm.js:97:10)

at Module._compile (module.js:542:28)

at Object.Module._extensions..js (module.js:579:10)

at Module.load (module.js:487:32)

at tryModuleLoad (module.js:446:12)

at Function.Module._load (module.js:438:3)

at Module.runMain (module.js:604:10)

at run (bootstrap_node.js:390:7)

at startup (bootstrap_node.js:150:9)

原因:没有对WebStorm运行React Native进行配置。

解决:需要对WebStorm进行配置后,才能运行React Native,参考:http://www.cnblogs.com/shaoting/p/6110202.html

4.Error running RunR: Please specify npm or yarn package

原因:没有配置npm或者yarn的路径,

解决:http://stackoverflow.com/questions/41318944/please-specify-npm-or-yarn-package-in-phpstorm-when-trying-to-install-a-new-np

5.ERROR  A non-recoverable condition has triggered.  Watchman needs your help!

终端运行:react-native start 报的错,如下:

ERROR  A non-recoverable condition has triggered.  Watchman needs your help!The triggering condition was at timestamp=1498047338: inotify-add-watch(/home/yaoyongchao/YouDemo/android/app/build/intermediates/transforms/mergeJniLibs/debug/folders/2000/1f/main/lib/arm64-v8a) -> The user limit on the total number of inotify watches was reached; increase the fs.inotify.max_user_watches sysctlAll requests will continue to fail with this message until you resolvethe underlying problem.  You will find more information on fixing this athttps://facebook.github.io/watchman/docs/troubleshooting.html#poison-inotify-add-watch{"watchmanResponse":{"version":"4.7.0","error":"A non-recoverable condition has triggered.  Watchman needs your help!\nThe triggering condition was at timestamp=1498047338: inotify-add-watch(/home/yaoyongchao/YouDemo/android/app/build/intermediates/transforms/mergeJniLibs/debug/folders/2000/1f/main/lib/arm64-v8a) -> The user limit on the total number of inotify watches was reached; increase the fs.inotify.max_user_watches sysctl\nAll requests will continue to fail with this message until you resolve\nthe underlying problem.  You will find more information on fixing this at\nhttps://facebook.github.io/watchman/docs/troubleshooting.html#poison-inotify-add-watch\n"}}Error: A non-recoverable condition has triggered.  Watchman needs your help!The triggering condition was at timestamp=1498047338: inotify-add-watch(/home/yaoyongchao/YouDemo/android/app/build/intermediates/transforms/mergeJniLibs/debug/folders/2000/1f/main/lib/arm64-v8a) -> The user limit on the total number of inotify watches was reached; increase the fs.inotify.max_user_watches sysctlAll requests will continue to fail with this message until you resolvethe underlying problem.  You will find more information on fixing this athttps://facebook.github.io/watchman/docs/troubleshooting.html#poison-inotify-add-watch    at ChildProcess.(/home/yaoyongchao/YouDemo/node_modules/react-native/node_modules/jest-haste-map/node_modules/sane/node_modules/fb-watchman/index.js:207:21)    at emitTwo (events.js:106:13)    at ChildProcess.emit (events.js:191:7)    at maybeClose (internal/child_process.js:886:16)    at Socket.(internal/child_process.js:342:11)

at emitOne (events.js:96:13)

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

at Pipe._handle.close [as _onclose] (net.js:497:12)

原因:因为inotify默认内核参数值太小。

解决:

方案一

$ sudo sysctl fs.inotify.max_user_watches=524288

$ watchman shutdown-server

参考来源

方案二

sudo su 

vim /etc/sysctl.conf

在文件里面添加**fs.inotify.max_user_watches=16384**(这个是系统默认值到两倍,够用了),:wq保存

然后运行/sbin/sysctl -p使其立即生效

使用sysclt -a可以看到fs.inotify.max_user_watches = 16384

或者直接查看/proc/sys/fs/inotify/max_user_watches这个文件(切勿直接修改这个文件,因为即使你修改了当时生效,等你重启电脑,这个值又会恢复默认)。

好了,再运行react-native start就OK了

参考来源

6.Command `yarn add react-native --exact` failed.

This will walk you through creating a new React Native project in /home/yaoyongchao/ws/rn/raa

Using yarn v0.27.5

Installing react-native...

yarn add v0.27.5

info No lockfile found.

[1/4] Resolving packages...

warning react-native > connect@2.30.2: connect 2.x series is deprecated

[2/4] Fetching packages...

warning fsevents@1.1.2: The platform "linux" is incompatible with this module.

info "fsevents@1.1.2" is an optional dependency and failed compatibility check. Excluding it from installation.

error hawk@6.0.2: The engine "node" is incompatible with this module. Expected version ">=4.5.0".

error Found incompatible module

info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

{ [Error: Command failed: yarn add react-native --exact]

error: null,

cmd: 'yarn add react-native --exact',

file: '/bin/sh',

args: [ '/bin/sh', '-c', 'yarn add react-native --exact' ],

options:

{ stdio: [ [Object], [Object], [Object] ],

file: '/bin/sh',

args: [ '/bin/sh', '-c', 'yarn add react-native --exact' ],

envPairs:

[ 'XDG_VTNR=7',

'LC_PAPER=zh_CN.UTF-8',

'LC_ADDRESS=zh_CN.UTF-8',

'AS_HOME=/opt/ide/android-studio',

'XDG_SESSION_ID=c2',

'XDG_GREETER_DATA_DIR=/var/lib/lightdm-data/yaoyongchao',

'LC_MONETARY=zh_CN.UTF-8',

'CLUTTER_IM_MODULE=xim',

'SESSION=ubuntu',

'GPG_AGENT_INFO=/home/yaoyongchao/.gnupg/S.gpg-agent:0:1',

'ANDROID_HOME=/opt/java/android-sdk-linux',

'TERM=xterm-256color',

'VTE_VERSION=4205',

'XDG_MENU_PREFIX=gnome-',

'SHELL=/bin/bash',

'QT_LINUX_ACCESSIBILITY_ALWAYS_ON=1',

'WINDOWID=79691786',

'LC_NUMERIC=zh_CN.UTF-8',

'UPSTART_SESSION=unix:abstract=/com/ubuntu/upstart-session/1000/1263',

'GNOME_KEYRING_CONTROL=',

'GTK_MODULES=gail:atk-bridge:unity-gtk-module',

'USER=yaoyongchao',

'LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:',

'QT_ACCESSIBILITY=1',

'LC_TELEPHONE=zh_CN.UTF-8',

'XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session0',

'XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0',

'SSH_AUTH_SOCK=/run/user/1000/keyring/ssh',

'SESSION_MANAGER=local/yaoyongchao:@/tmp/.ICE-unix/1482,unix/yaoyongchao:/tmp/.ICE-unix/1482',

'DEFAULTS_PATH=/usr/share/gconf/ubuntu.default.path',

'XDG_CONFIG_DIRS=/etc/xdg/xdg-ubuntu:/usr/share/upstart/xdg:/etc/xdg',

'DESKTOP_SESSION=ubuntu',

'PATH=/home/yaoyongchao/bin:/home/yaoyongchao/.local/bin:/opt/ide/android-studio/bin:/opt/java/android-sdk-linux/tools:/opt/java/android-sdk-linux/platform-tools:/opt/java/jdk1.8.0_144/bin:/opt/java/jdk1.8.0_144/jre/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin',

'QT_IM_MODULE=fcitx',

'QT_QPA_PLATFORMTHEME=appmenu-qt5',

'LC_IDENTIFICATION=zh_CN.UTF-8',

'XDG_SESSION_TYPE=x11',

'PWD=/home/yaoyongchao/ws/rn',

'JOB=dbus',

'XMODIFIERS=@im=fcitx',

'JAVA_HOME=/opt/java/jdk1.8.0_144',

'LANG=zh_CN.UTF-8',

'GNOME_KEYRING_PID=',

'GDM_LANG=zh_CN',

'MANDATORY_PATH=/usr/share/gconf/ubuntu.mandatory.path',

'LC_MEASUREMENT=zh_CN.UTF-8',

'COMPIZ_CONFIG_PROFILE=ubuntu',

'IM_CONFIG_PHASE=1',

'GDMSESSION=ubuntu',

'SESSIONTYPE=gnome-session',

'GTK2_MODULES=overlay-scrollbar',

'SHLVL=1',

'HOME=/home/yaoyongchao',

'XDG_SEAT=seat0',

'LANGUAGE=zh_CN:zh:en_US:en',

'GNOME_DESKTOP_SESSION_ID=this-is-deprecated',

'XDG_SESSION_DESKTOP=ubuntu',

'LOGNAME=yaoyongchao',

'DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-Az44WlzhBc',

'XDG_DATA_DIRS=/usr/share/ubuntu:/usr/share/gnome:/usr/local/share/:/usr/share/:/var/lib/snapd/desktop',

'CLASSPATH=.:/opt/java/jdk1.8.0_144/lib:/opt/java/jdk1.8.0_144/jre/lib:',

'QT4_IM_MODULE=fcitx',

'LESSOPEN=| /usr/bin/lesspipe %s',

'INSTANCE=',

'XDG_RUNTIME_DIR=/run/user/1000',

'DISPLAY=:0',

'XDG_CURRENT_DESKTOP=Unity',

'GTK_IM_MODULE=fcitx',

'LESSCLOSE=/usr/bin/lesspipe %s %s',

'LC_TIME=zh_CN.UTF-8',

'LC_NAME=zh_CN.UTF-8',

'XAUTHORITY=/home/yaoyongchao/.Xauthority',

'_=/usr/local/bin/react-native' ] },

envPairs:

[ 'XDG_VTNR=7',

'LC_PAPER=zh_CN.UTF-8',

'LC_ADDRESS=zh_CN.UTF-8',

'AS_HOME=/opt/ide/android-studio',

'XDG_SESSION_ID=c2',

'XDG_GREETER_DATA_DIR=/var/lib/lightdm-data/yaoyongchao',

'LC_MONETARY=zh_CN.UTF-8',

'CLUTTER_IM_MODULE=xim',

'SESSION=ubuntu',

'GPG_AGENT_INFO=/home/yaoyongchao/.gnupg/S.gpg-agent:0:1',

'ANDROID_HOME=/opt/java/android-sdk-linux',

'TERM=xterm-256color',

'VTE_VERSION=4205',

'XDG_MENU_PREFIX=gnome-',

'SHELL=/bin/bash',

'QT_LINUX_ACCESSIBILITY_ALWAYS_ON=1',

'WINDOWID=79691786',

'LC_NUMERIC=zh_CN.UTF-8',

'UPSTART_SESSION=unix:abstract=/com/ubuntu/upstart-session/1000/1263',

'GNOME_KEYRING_CONTROL=',

'GTK_MODULES=gail:atk-bridge:unity-gtk-module',

'USER=yaoyongchao',

'LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:',

'QT_ACCESSIBILITY=1',

'LC_TELEPHONE=zh_CN.UTF-8',

'XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session0',

'XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0',

'SSH_AUTH_SOCK=/run/user/1000/keyring/ssh',

'SESSION_MANAGER=local/yaoyongchao:@/tmp/.ICE-unix/1482,unix/yaoyongchao:/tmp/.ICE-unix/1482',

'DEFAULTS_PATH=/usr/share/gconf/ubuntu.default.path',

'XDG_CONFIG_DIRS=/etc/xdg/xdg-ubuntu:/usr/share/upstart/xdg:/etc/xdg',

'DESKTOP_SESSION=ubuntu',

'PATH=/home/yaoyongchao/bin:/home/yaoyongchao/.local/bin:/opt/ide/android-studio/bin:/opt/java/android-sdk-linux/tools:/opt/java/android-sdk-linux/platform-tools:/opt/java/jdk1.8.0_144/bin:/opt/java/jdk1.8.0_144/jre/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin',

'QT_IM_MODULE=fcitx',

'QT_QPA_PLATFORMTHEME=appmenu-qt5',

'LC_IDENTIFICATION=zh_CN.UTF-8',

'XDG_SESSION_TYPE=x11',

'PWD=/home/yaoyongchao/ws/rn',

'JOB=dbus',

'XMODIFIERS=@im=fcitx',

'JAVA_HOME=/opt/java/jdk1.8.0_144',

'LANG=zh_CN.UTF-8',

'GNOME_KEYRING_PID=',

'GDM_LANG=zh_CN',

'MANDATORY_PATH=/usr/share/gconf/ubuntu.mandatory.path',

'LC_MEASUREMENT=zh_CN.UTF-8',

'COMPIZ_CONFIG_PROFILE=ubuntu',

'IM_CONFIG_PHASE=1',

'GDMSESSION=ubuntu',

'SESSIONTYPE=gnome-session',

'GTK2_MODULES=overlay-scrollbar',

'SHLVL=1',

'HOME=/home/yaoyongchao',

'XDG_SEAT=seat0',

'LANGUAGE=zh_CN:zh:en_US:en',

'GNOME_DESKTOP_SESSION_ID=this-is-deprecated',

'XDG_SESSION_DESKTOP=ubuntu',

'LOGNAME=yaoyongchao',

'DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-Az44WlzhBc',

'XDG_DATA_DIRS=/usr/share/ubuntu:/usr/share/gnome:/usr/local/share/:/usr/share/:/var/lib/snapd/desktop',

'CLASSPATH=.:/opt/java/jdk1.8.0_144/lib:/opt/java/jdk1.8.0_144/jre/lib:',

'QT4_IM_MODULE=fcitx',

'LESSOPEN=| /usr/bin/lesspipe %s',

'INSTANCE=',

'XDG_RUNTIME_DIR=/run/user/1000',

'DISPLAY=:0',

'XDG_CURRENT_DESKTOP=Unity',

'GTK_IM_MODULE=fcitx',

'LESSCLOSE=/usr/bin/lesspipe %s %s',

'LC_TIME=zh_CN.UTF-8',

'LC_NAME=zh_CN.UTF-8',

'XAUTHORITY=/home/yaoyongchao/.Xauthority',

'_=/usr/local/bin/react-native' ],

stderr: null,

stdout: null,

pid: 3919,

output: [ null, null, null ],

signal: null,

status: 1 }

Command `yarn add react-native --exact` failed.

解决方案:根据日志,升级node到最新的版本,问题解决。

7.ERROR A non-recoverable condition has triggered.

ERROR A non-recoverable condition has triggered. Watchman needs your help!

The triggering condition was at timestamp=1514253347: inotify-add-watch(/home/andy/ws/rn/ODemo) -> The user limit on the total number of inotify watches was reached; increase the fs.inotify.max_user_watches sysctl

All requests will continue to fail with this message until you resolve

the underlying problem.  You will find more information on fixing this at

https://facebook.github.io/watchman/docs/troubleshooting.html#poison-inotify-add-watch

解决方法:终端输入如下:

echo 32768 | sudo tee -a /proc/sys/fs/inotify/max_queued_events

echo 65536 | sudo tee -a /proc/sys/fs/inotify/max_user_watches

watchman shutdown-server

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 159,117评论 4 362
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 67,328评论 1 293
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 108,839评论 0 243
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 44,007评论 0 206
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 52,384评论 3 287
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 40,629评论 1 219
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 31,880评论 2 313
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 30,593评论 0 198
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 34,313评论 1 243
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 30,575评论 2 246
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 32,066评论 1 260
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 28,392评论 2 253
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 33,052评论 3 236
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 26,082评论 0 8
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 26,844评论 0 195
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 35,662评论 2 274
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 35,575评论 2 270

推荐阅读更多精彩内容