【问题标题】:React Native: Error while downgrading from 0.51 to 0.45React Native:从 0.51 降级到 0.45 时出错
【发布时间】:2018-06-03 00:28:42
【问题描述】:

我想降级我的项目,因为一些第三方包没有更新最新版本的 react-native。我正在使用 Xcode 9.0

当我尝试降级我的 react-native 版本时,我收到此错误:

错误: /Users/......./node_modules/react-native/ReactCommon/privatedata/PrivateDataBase.h: 没有这样的文件或目录

我关注的要点:

package.json我把版本从0.51改成了0.45

然后运行 ​​npm install。

【问题讨论】:

  • 您还需要更改支持 react-native 0.45 的其他模块版本。现在所有模块都与 react-native 0.51 相关,而不是 0.45
  • 我想添加 react-native-permissions 但它显示未满足的对等依赖关系为 0.51
  • 这意味着您使用的react-native-permissions 的任何版本都支持0.51 或更高版本。
  • 需要添加支持react native 0.45的react-native-permissions版本。

标签: javascript ios reactjs react-native react-redux


【解决方案1】:

如果您更改 package.json 中的某些内容,请确保同时删除您的 package-lock.json。

我总是在更改以下脚本后执行:

watchman watch-del-all 1>/dev/null

rm -rf node_modules 1>/dev/null
rm -rf yarn.lock  1>/dev/null
rm -rf package-lock.json 1>/dev/null
rm -rf $TMPDIR/react-packager-* 1>/dev/null
rm -rf ios/build 1>/dev/null
rm -rf android/build 1>/dev/null

npm cache clear --force -s 1>/dev/null
npm cache verify 1>/dev/null

来自:https://gist.github.com/skizzo/8633169b4f1b0e781c83af4d52ec7249

如果您仍然遇到版本不匹配的问题,请尝试:

npm uninstall your-package-you-want-to-remove &&  npm install your-package-you-want-to-remove@1.0.0 (fixed version number)
react-native link

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-10-06
    • 2018-11-24
    • 2020-09-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多