【问题标题】:react-native link giving error no such file or directory info.plistreact-native 链接给出错误没有这样的文件或目录 info.plist
【发布时间】:2018-08-17 14:30:00
【问题描述】:

我正在尝试向我的 react-native 项目添加新字体。

我已经在 package.json 中添加了这个

  "rnpm": {
    "assets": [
      "./assets/fonts/"
    ]
  }

并在assets文件夹以及项目中添加了相应的字体文件。

在链接我需要运行的字体的过程中-

react-native link 

但是在运行上述命令时,我收到了这个错误 -

Error: ENOENT: no such file or directory, open '/private/var/native-testProject/ios/"tests_tvOSTests/Info.plist"'
    at Object.fs.openSync (fs.js:667:18)
    at Object.fs.readFileSync (fs.js:572:33)
    at Object.<anonymous> (/private/var/www/native-testProject/node_modules/react-native-code-push/scripts/postlink/ios/postlink.js:63:24)
    at Module._compile (module.js:662:30)
    at Object.Module._extensions..js (module.js:673:10)
    at Module.load (module.js:575:32)
    at tryModuleLoad (module.js:515:12)
    at Function.Module._load (module.js:507:3)
    at Module.require (module.js:606:17)
    at require (internal/module.js:11:18)

在查看项目结构时,我还能够找到 info.plist 文件。

我对 react-native 很陌生,我不知道我哪里出错了。

【问题讨论】:

  • 这个错误基本上是在项目中路径错误,文件名无效和文件丢失时出现的。请再次查看此 Info.plist 文件代表 tvOS,确保文件位于“/private/var/native-testProject/ios/”tests_tvOSTests/Info.plist”。
  • @PaulMarshal 我不知道该文件夹是如何创建的以及该文件夹的实际用途是什么。
  • 这个文件夹是在 react native 新建项目时自动创建的。

标签: javascript react-native fonts info.plist


【解决方案1】:

在查看文档时我发现我需要运行

react-native upgrade

然后我的问题是,当我运行升级时,项目结构中没有引用 tests_tvOSTests 的一些方式。

【讨论】:

    猜你喜欢
    • 2018-05-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-01-05
    • 2018-09-14
    • 2021-06-15
    • 2019-09-08
    • 2018-08-09
    相关资源
    最近更新 更多