? ? ? ?最近發(fā)現(xiàn)市場上對React Native開發(fā)人員的需求挺多的脯丝,自己就想學(xué)習(xí)一下React Native宠进,多一門技術(shù)砰苍,好將來買個好價位赚导。嘿嘿!
? ? ? ?在學(xué)習(xí)React Native中碰到了不少坑圈暗,再次記錄下來以備自己以后查閱员串,當(dāng)然了寸齐,也會持續(xù)更新扰法。
? ? ? ? 只寫學(xué)習(xí)中碰到的問題塞颁。至于安裝請移步:搭建開發(fā)環(huán)境祠锣,我安裝的是React Native0.44
本人使用的是Ubuntu16.04操作系統(tǒng)锤岸,按上面鏈接中的安裝教程安裝的,安裝過程挺順利的蛋铆。沒有碰到什么棘手的問題放接。但是安裝成功后玛瘸,創(chuàng)建項目運行是出問題了糊渊。
1.error calling appregistry.run application
按教程渺绒,cd到目錄下宗兼,運行:react-nativerun-android殷绍,但是運行效果手機一片紅篡帕,如下:
原因:是沒有啟動服務(wù)器端镰烧。
答:在Android手機測試之前,要 ? 一定要先
啟動JS服務(wù)器端结执,執(zhí)行命令:
react-native start
命令執(zhí)行結(jié)果:
上面的問題就解決了献幔。
2.This warning is caused by a @providesModule declaration with the same name across two different files
運行react-native start 開始服務(wù)器蜡感,報一下錯誤。
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的路徑州刽,
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默認內(nèi)核參數(shù)值太小。
解決:
方案一
$ sudo sysctl fs.inotify.max_user_watches=524288
$ watchman shutdown-server
方案二
sudo su?
vim /etc/sysctl.conf
在文件里面添加**fs.inotify.max_user_watches=16384**(這個是系統(tǒng)默認值到兩倍袍镀,夠用了)绸吸,:wq保存
然后運行/sbin/sysctl -p使其立即生效
使用sysclt -a可以看到fs.inotify.max_user_watches = 16384
或者直接查看/proc/sys/fs/inotify/max_user_watches這個文件(切勿直接修改這個文件设江,因為即使你修改了當(dāng)時生效叉存,等你重啟電腦歼捏,這個值又會恢復(fù)默認)甫菠。
好了拂苹,再運行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.
解決方案:根據(jù)日志跺撼,升級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