React Native踩坑筆記(持續(xù)更新中...)

? ? ? ?最近發(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的路徑州刽,

解決: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默認內(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

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末卢佣,一起剝皮案震驚了整個濱河市珠漂,隨后出現(xiàn)的幾起案子,更是在濱河造成了極大的恐慌冈敛,老刑警劉巖鸣皂,帶你破解...
    沈念sama閱讀 206,214評論 6 481
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件癌压,死亡現(xiàn)場離奇詭異滩届,居然都是意外死亡帜消,警方通過查閱死者的電腦和手機泡挺,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 88,307評論 2 382
  • 文/潘曉璐 我一進店門,熙熙樓的掌柜王于貴愁眉苦臉地迎上來媳溺,“玉大人,你說我怎么就攤上這事跪腹」由荆” “怎么了?”我有些...
    開封第一講書人閱讀 152,543評論 0 341
  • 文/不壞的土叔 我叫張陵冲茸,是天一觀的道長屯阀。 經(jīng)常有香客問我缅帘,道長,這世上最難降的妖魔是什么难衰? 我笑而不...
    開封第一講書人閱讀 55,221評論 1 279
  • 正文 為了忘掉前任钦无,我火速辦了婚禮,結(jié)果婚禮上盖袭,老公的妹妹穿的比我還像新娘弟塞。我一直安慰自己,他們只是感情好,可當(dāng)我...
    茶點故事閱讀 64,224評論 5 371
  • 文/花漫 我一把揭開白布缤至。 她就那樣靜靜地躺著,像睡著了一般。 火紅的嫁衣襯著肌膚如雪。 梳的紋絲不亂的頭發(fā)上,一...
    開封第一講書人閱讀 49,007評論 1 284
  • 那天实牡,我揣著相機與錄音,去河邊找鬼。 笑死巡雨,一個胖子當(dāng)著我的面吹牛炕舵,可吹牛的內(nèi)容都是我干的。 我是一名探鬼主播蒜危,決...
    沈念sama閱讀 38,313評論 3 399
  • 文/蒼蘭香墨 我猛地睜開眼,長吁一口氣:“原來是場噩夢啊……” “哼赘风!你這毒婦竟也來了瞬捕?” 一聲冷哼從身側(cè)響起笋轨,我...
    開封第一講書人閱讀 36,956評論 0 259
  • 序言:老撾萬榮一對情侶失蹤,失蹤者是張志新(化名)和其女友劉穎,沒想到半個月后,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體柬泽,經(jīng)...
    沈念sama閱讀 43,441評論 1 300
  • 正文 獨居荒郊野嶺守林人離奇死亡,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點故事閱讀 35,925評論 2 323
  • 正文 我和宋清朗相戀三年台汇,在試婚紗的時候發(fā)現(xiàn)自己被綠了严衬。 大學(xué)時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片俄精。...
    茶點故事閱讀 38,018評論 1 333
  • 序言:一個原本活蹦亂跳的男人離奇死亡沫勿,死狀恐怖馆衔,靈堂內(nèi)的尸體忽然破棺而出,到底是詐尸還是另有隱情左冬,我是刑警寧澤,帶...
    沈念sama閱讀 33,685評論 4 322
  • 正文 年R本政府宣布逊谋,位于F島的核電站后德,受9級特大地震影響,放射性物質(zhì)發(fā)生泄漏。R本人自食惡果不足惜鹰服,卻給世界環(huán)境...
    茶點故事閱讀 39,234評論 3 307
  • 文/蒙蒙 一屠尊、第九天 我趴在偏房一處隱蔽的房頂上張望既峡。 院中可真熱鬧档痪,春花似錦腐螟、人聲如沸。這莊子的主人今日做“春日...
    開封第一講書人閱讀 30,240評論 0 19
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽寂曹。三九已至匾灶,卻和暖如春鸟赫,著一層夾襖步出監(jiān)牢的瞬間樊拓,已是汗流浹背。 一陣腳步聲響...
    開封第一講書人閱讀 31,464評論 1 261
  • 我被黑心中介騙來泰國打工塘慕, 沒想到剛下飛機就差點兒被人妖公主榨干…… 1. 我叫王不留筋夏,地道東北人。 一個月前我還...
    沈念sama閱讀 45,467評論 2 352
  • 正文 我出身青樓苍糠,卻偏偏與公主長得像赴恨,于是被迫代替她去往敵國和親铸屉。 傳聞我的和親對象是個殘疾皇子,可洞房花燭夜當(dāng)晚...
    茶點故事閱讀 42,762評論 2 345

推薦閱讀更多精彩內(nèi)容