react-native -問題統(tǒng)計

// 001

為什么用npm安裝的時候所有的都會出現(xiàn)下面這樣的警告信息啊??? npm WARN enoent ENOENT: no such file or directory, open 'D:\web\Imooc\package.json' npm WARN Imooc No description npm WARN Imooc No repository field. npm WARN Imooc No README data npm WARN Imooc No license field. 這個問題要怎么解決?
npm init -f // 補齊package.json中缺失的鍵值對
直接npm init -f,再install

// 002

Module JSTimersExecution is not a registered callabled module
版本使用 "react-native": "0.46.4",
Native module cannot be null

// 003

Undefined symbols for architecture x86_64:
"_YGFlexDirectionToString", referenced from:
_YGNodePrintInternal in Yoga.o
"_YGJustifyToString", referenced from:
_YGNodePrintInternal in Yoga.o
"_YGEdgeToString", referenced from:
_YGPrintEdges in Yoga.o
"_YGOverflowToString", referenced from:
_YGNodePrintInternal in Yoga.o
"_YGAlignToString", referenced from:
_YGNodePrintInternal in Yoga.o
"_YGWrapToString", referenced from:
_YGNodePrintInternal in Yoga.o
"_YGDisplayToString", referenced from:
_YGNodePrintInternal in Yoga.o
"_YGPositionTypeToString", referenced from:
_YGNodePrintInternal in Yoga.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
[圖片上傳中。。。(1)]

// 004

問題集錦
http://www.lxweimin.com/p/b182722df7a5

// 005

[!] Unable to find a specification for Folly (= 2016.09.26.00) depended upon by React/CxxBridge
pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec’

[!] Unable to find a specification for DoubleConversion depended upon by Folly
pod 'DoubleConversion', :podspec => '../YE/RN/node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'

[!] Unable to find a specification for GLog depended upon by Folly
pod 'GLog', :podspec => '../YE/RN/node_modules/react-native/third-party-podspecs/GLog.podspec’

B797D704-E1B8-4A91-8078-D60CE0CB2B77.png
// 006
[!] /bin/bash -c
set -e
#!/bin/bash
set -e

PLATFORM_NAME="${PLATFORM_NAME:-iphoneos}"
CURRENT_ARCH="${CURRENT_ARCH:-armv7}"

export CC="$(xcrun -find -sdk $PLATFORM_NAME cc) -arch     $CURRENT_ARCH -isysroot $(xcrun -sdk $PLATFORM_NAME --show-sdk-path)"
export CXX="$CC"

# Remove automake symlink if it exists
if [ -h "test-driver" ]; then
    rm test-driver
fi

./configure --host arm-apple-darwin

# Fix build for tvOS
cat << EOF >> src/config.h

/* Add in so we have Apple Target Conditionals */
#ifdef __APPLE__
#include <TargetConditionals.h>
#include <Availability.h>
#endif

/* Special configuration for AppleTVOS */
#if TARGET_OS_TV
#undef HAVE_SYSCALL_H
#undef HAVE_SYS_SYSCALL_H
#undef OS_MACOSX
#endif

/* Special configuration for ucontext */
#undef HAVE_UCONTEXT_H
#undef PC_FROM_UCONTEXT
#if defined(__x86_64__)
#define PC_FROM_UCONTEXT uc_mcontext->__ss.__rip
#elif defined(__i386__)
#define PC_FROM_UCONTEXT uc_mcontext->__ss.__eip
#endif
EOF

checking for a BSD-compatible install... /usr/local/bin/ginstall -c
checking whether build environment is sane... yes
checking for arm-apple-darwin-strip... no
checking for strip... strip
checking for a thread-safe mkdir -p... /usr/local/bin/gmkdir -p
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for arm-apple-darwin-gcc...     
/Library/Developer/CommandLineTools/usr/bin/cc -arch armv7 -isysroot
checking whether the C compiler works... no
xcrun: error: SDK "iphoneos" cannot be located
xcrun: error: SDK "iphoneos" cannot be located
xcrun: error: SDK "iphoneos" cannot be located
xcrun: error: unable to lookup item 'Path' in SDK 'iphoneos'
/Users/jianan/Library/Caches/CocoaPods/Pods/External/GLog/f09d6cdb8398b4922e87d51f5245de7e-3e4e4/missing: Unknown `--is-lightweight' option
Try     `/Users/jianan/Library/Caches/CocoaPods/Pods/External/GLog/f09d6cdb8398b4922e87d51f5245de7e-3e4e4/missing --help' for more information
configure: WARNING: 'missing' script is too old or missing
configure: error: in `/Users/jianan/Library/Caches/CocoaPods/Pods/External/GLog/f09d6cdb8398b4922e87d51f5245de7e-3e4e4':
configure: error: C compiler cannot create executables
See `config.log' for more details

因為裝多個xocde導(dǎo)致
命令行解決鏈接:https://www.bbsmax.com/A/lk5aEq1o51/
或者
打開xcode...

12AABEC1-42F0-4214-978F-FBD3545D1A5C.png
// 007

Could not connect to development server.

43591BD8-0B71-499A-83CD-DE0D937F57CE.png

執(zhí)行 npm start
jianan:RN> npm start

// 008

Native module cannot be null.

2AC04A0F-B682-4D91-A6B5-1AD8C61EB2A9.png

解決辦法:
http://reactnative.cn/docs/0.49/linking-libraries-ios.html#content

// 009

'fishhook/fishhook.h' file not found
.#import “fishhook.h”

// 010

undefined is not an object (evaludating ‘_react2_React.Component’)
import React, {
Component
} from 'react’;

// 011

EE23705F-497B-4358-8E5C-087A619B5CC5.png

Connection to http://127.0.0.1:8081/debugger-prox …….. if you have the right IP address in ‘RCTWebSocketExecutor.m’
執(zhí)行:
npm start

// 012
FC5A4B06-F3D6-479D-83C7-CF65018B79FA.png

Unable to resoleve module ‘./TabNavigatorView’ from ‘/User/……/index.ios.js’: could not resolve '/User/……/TabNavigatorView’ as a file nor as a folder

// 013

ERROR Packager can't listen on port 8081
Loading dependency graph...npm ERR! code ELIFECYCLE
npm ERR! errno 11
npm ERR! YE@0.0.1 start: node node_modules/react-native/local-cli/cli.js start
npm ERR! Exit status 11
npm ERR!
npm ERR! Failed at the YE@0.0.1 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/jianan/.npm/_logs/2017-10-18T09_23_44_470Z-debug.log

解決辦法:
react-native start --port=8080

// 014

Runtime is not ready for debugging.Make sure Packager server is running.

68E40623-3FBA-4EA5-AF77-357D593BBAA1.png
173A0BB2-D372-41DE-AB5F-1A8634F9395D.png

解決辦法:
RCTWebSocketExecutor.m 類中端口更改為和使用命令:react-native start --port=8080的端口一樣時候一樣的

// 015

StyleSheet is not defined
import {
StyleSheet,
} from 'react-native';

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

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