陈桥驿站 陈桥驿站

ReactNative 升级踩坑记录

--> React Native 阅读 ( 42 ) 文章转载请注明来源!

前言

好久没有做React Native了,之前一直用的0.55.3版本,看现在挂网升到0.62,所以准备尝尝鲜。

版本

0.60及以上

基本不考虑,需要安装CocoaPods,而且会出现很多问题。

0.59.0

上来就直接报错,而且Stack Overflow上面很多人遇见了我这种问题。

Error: Unable to resolve module `./index` from `/Users/mac/ZhonglianNewspaper/node_modules/react-native/.`: The module `./index` could not be found from `/Users/mac/ZhonglianNewspaper/node_modules/react-native/.`. Indeed, none of these files exist:
  * `/Users/mac/ZhonglianNewspaper/node_modules/react-native/index(.native||.ios.js|.native.js|.js|.ios.json|.native.json|.json|.ios.ts|.native.ts|.ts|.ios.tsx|.native.tsx|.tsx)`
  * `/Users/mac/ZhonglianNewspaper/node_modules/react-native/index/index(.native||.ios.js|.native.js|.js|.ios.json|.native.json|.json|.ios.ts|.native.ts|.ts|.ios.tsx|.native.tsx|.tsx)`
    at ModuleResolver.resolveDependency (/Users/mac/ZhonglianNewspaper/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:163:15)
    at ResolutionRequest.resolveDependency (/Users/mac/ZhonglianNewspaper/node_modules/metro/src/node-haste/DependencyGraph/ResolutionRequest.js:52:18)
    at DependencyGraph.resolveDependency (/Users/mac/ZhonglianNewspaper/node_modules/metro/src/node-haste/DependencyGraph.js:283:16)
    at /Users/mac/ZhonglianNewspaper/node_modules/metro/src/lib/transformHelpers.js:261:42
    at Server.<anonymous> (/Users/mac/ZhonglianNewspaper/node_modules/metro/src/Server.js:1038:41)
    at Generator.next (<anonymous>)
    at asyncGeneratorStep (/Users/mac/ZhonglianNewspaper/node_modules/metro/src/Server.js:99:24)
    at _next (/Users/mac/ZhonglianNewspaper/node_modules/metro/src/Server.js:119:9)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)

0.58.6

又报错了,我也懒得再研究了,老老实实的用我的0.55.3去。

PBXCp /Users/mac/ZhonglianNewspaper/node_modules/react-native/ReactCommon/yoga/yoga/YGValue.h /Users/mac/Library/Developer/Xcode/DerivedData/ZhonglianNewspaper-hclygrvzkmvurhcslmkmfasvuhem/Build/Products/Debug-iphonesimulator/include/yoga/YGValue.h (in target 'yoga' from project 'React')
    cd /Users/mac/ZhonglianNewspaper/node_modules/react-native/React
    builtin-copy -exclude .DS_Store -exclude CVS -exclude .svn -exclude .git -exclude .hg -resolve-src-symlinks /Users/mac/ZhonglianNewspaper/node_modules/react-native/ReactCommon/yoga/yoga/YGValue.h /Users/mac/Library/Developer/Xcode/DerivedData/ZhonglianNewspaper-hclygrvzkmvurhcslmkmfasvuhem/Build/Products/Debug-iphonesimulator/include/yoga

error: /Users/mac/ZhonglianNewspaper/node_modules/react-native/ReactCommon/yoga/yoga/YGValue.h: No such file or directory (in target 'yoga' from project 'React')

本文基于《署名-非商业性使用-相同方式共享 4.0 国际 (CC BY-NC-SA 4.0)》许可协议授权
文章链接:http://www.cctv3.net/archives/rnUpdates.html (转载时请注明本文出处及文章链接)

React Native
发表新评论
雷姆
拉姆