首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >试图升级本机,获取令人困惑的信息

试图升级本机,获取令人困惑的信息
EN

Stack Overflow用户
提问于 2019-06-10 15:43:54
回答 1查看 1.8K关注 0票数 2

我正在遵循以下指南:https://facebook.github.io/react-native/docs/upgrading.html

然而,我得到了这个打印出来:

代码语言:javascript
复制
> react-native upgrade 0.59
Scanning folders for symlinks in /Users/danale/Projects/engage-application.mobile/node_modules (18ms)
You should consider using the new upgrade tool based on Git. It makes upgrades easier by resolving most conflicts automatically.
To use it:
- Go back to the old version of React Native
- Run "npm install -g react-native-git-upgrade"
- Run "react-native-git-upgrade"
See https://facebook.github.io/react-native/docs/upgrading.html
Upgrading project to react-native v0.53.3
Check out the release notes and breaking changes: https://github.com/facebook/react-native/releases/tag/v0.53.0
.babelrc has changed in the new version.
Do you want to keep your .babelrc or replace it with the latest version?
If you ever made any changes to this file, you'll probably want to keep it.
You can see the new version here: /Users/danale/Projects/engage-application.mobile/node_modules/react-native/local-cli/templates/HelloWorld/_babelrc
Do you want to replace .babelrc? Answer y to replace, n to keep your version:

我扼杀了这个过程,因为我搞不懂为什么它认为我想升级到我已经拥有的版本?

如果我尝试输出中的建议,就会得到以下错误:

代码语言:javascript
复制
Output:
fatal: working tree '.' already exists.
git-upgrade ERR! An error occurred during upgrade:
git-upgrade ERR! Error: Command 'yarn add react-native@0.59.9 react@16.8.3' exited with code 1:
stderr: undefinedwarning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
warning babel-preset-env > browserslist@1.7.7: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
error Command failed.
Exit code: 128
Command: git
Arguments: clone https://github.com/jjd314/react-native-swipe-view /Users/danale/Library/Caches/Yarn/v2/.tmp/657474cb39d30bc7457c09c627f92462
Directory: /Users/danale/Projects/engage-application.mobile
Output:
fatal: working tree '.' already exists.

stdout: yarn add v1.10.1
[1/4] Resolving packages...
[2/4] Fetching packages...
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

    at ChildProcess.child.on.code (/usr/local/lib/node_modules/react-native-git-upgrade/cliEntry.js:58:18)
    at ChildProcess.emit (events.js:197:13)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:254:12)
git-upgrade ERR! Restore initial sources
Note: checking out 'project-snapshot'.
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-06-10 16:12:53

您没有正确使用react-native upgrade命令。您所链接的指南指出,您需要:

  1. 升级react本机依赖关系。因此,在本例中,您需要运行:npm install --save react-native@0.59
  2. 运行升级命令:react-native upgrade
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/56529525

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档