小编Iva*_*Iva的帖子

TypeError:cli.init 不是 React Native 的函数

在 MacBook Air M1 芯片中运行 npx react-native init appName 时

TypeError: cli.init is not a function
at run (/opt/homebrew/lib/node_modules/react-native-cli/index.js:302:7)
at createProject (/opt/homebrew/lib/node_modules/react-native-cli/index.js:249:3)
at init (/opt/homebrew/lib/node_modules/react-native-cli/index.js:200:5)
at Object.<anonymous> (/opt/homebrew/lib/node_modules/react-native-cli/index.js:153:7)
at Module._compile (node:internal/modules/cjs/loader:1112:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1166:10)
at Module.load (node:internal/modules/cjs/loader:988:32)
at Module._load (node:internal/modules/cjs/loader:834:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
at node:internal/main/run_main_module:17:47
Run Code Online (Sandbox Code Playgroud)

javascript typeerror ios react-native apple-m1

99
推荐指数
4
解决办法
13万
查看次数

本地图像未在发布和 TestFlight 中渲染

使用react-native v0.63.4,并且所有本地图像在开发模式下加载良好

<Image
    source={require('../assets/images/xyz.png')}
    style={styles.img}
    resizeMode="cover"
/>
Run Code Online (Sandbox Code Playgroud)

但是一旦我们在发布模式或试飞中构建它,加载的所有图像都require不会被渲染。

到目前为止我发现了什么:

  1. 似乎不是https://github.com/facebook/react-native/issues/29268,因为我使用的是 0.63.4
  2. 检查了 IPA 文件,它确实包含所有图像

提前致谢!

javascript react-native

6
推荐指数
1
解决办法
1125
查看次数

rn-fetch-blob 包包含无效配置:不允许“dependency.hooks”

rn-fetch-blob 包包含无效配置:不允许“dependency.hooks”。请使用“react-native config”命令验证其是否正确链接,并就此联系软件包维护人员。

package.json - “react-native”:“0.69.2”,“rn-fetch-blob”:“^0.12.0”

dependencies react-native react-hooks rn-fetch-blob

3
推荐指数
1
解决办法
1万
查看次数