Abd*_*heb 3 upgrade react-native
我尝试使用这些说明将 React Native 版本从 0.41 升级到 0.44 ,但出现此错误:
error Command failed.
Exit code: 128
Command: git
Arguments: clone https://github.com/lwansbrough/react-native-camera.git /Users/abdelnacer/Library/Caches/Yarn/v1/.tmp/264e7f98ae7b8a32797877705f218964
Directory: /Users/abdelnacer/work/react/DuluxTradePoints
Output:
fatal: working tree '.' already exists.
git-upgrade ERR! An error occurred during upgrade:
git-upgrade ERR! Error: Command 'yarn add react-native@0.42.0' exited with code 1:
stderr: undefinederror Command failed.
Exit code: 128
Command: git
Arguments: clone https://github.com/lwansbrough/react-native-camera.git /Users/abdelnacer/Library/Caches/Yarn/v1/.tmp/264e7f98ae7b8a32797877705f218964
Directory: /Users/abdelnacer/work/react/DuluxTradePoints
Output:
fatal: working tree '.' already exists.
stdout: yarn add v0.24.5
[1/4] Resolving 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 emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:194:7)
at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
git-upgrade ERR! Restore initial sources
Note: checking out 'project-snapshot'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:
git checkout -b <new-branch-name>
HEAD is now at 4c8828d... Project snapshot
Run Code Online (Sandbox Code Playgroud)
可能有人知道我做错了什么?
我尝试了几个yarn+react-native-git-upgrade但它对我不起作用
为了使升级工作正常进行,我必须删除 node_modules 并清理纱线缓存。
1)删除node_modules:
rm -rf ./node_modules
Run Code Online (Sandbox Code Playgroud)
2)清理纱线缓存
rm -rf /Users/<myUsername>/Library/Caches/Yarn/v1/.tmp
yarn cache clean
Run Code Online (Sandbox Code Playgroud)
我不确定它是否适用于仅删除.tmp
3)运行 yarn
4)再次运行升级
react-native-git-upgrade
Run Code Online (Sandbox Code Playgroud)
注意:我的升级是从0.51.0到0.53.3
| 归档时间: |
|
| 查看次数: |
2786 次 |
| 最近记录: |