Trying to upgrade using cli react-native-git-upgrade 0.39.2
~/D/D/M/R/_/Smish ❯❯❯ react-native-git-upgrade 0.39.2 dc/upgrade_39 ✭
git-upgrade info Check for updates
git-upgrade info Using yarn 0.18.1
git-upgrade info Read package.json files
git-upgrade info Check declared version
git-upgrade info Check matching versions
git-upgrade info Check React peer dependency
git-upgrade info Check that Git is installed
git-upgrade info Get information from NPM registry
git-upgrade info Upgrading to React Native 0.39.2, React ~15.4.0-rc.4
git-upgrade info Setup temporary working directory
git-upgrade info Configure Git environment
git-upgrade info Init Git repository
git-upgrade info Add all files to commit
git-upgrade info Commit current project sources
git-upgrade info Create a tag before updating sources
git-upgrade info Generate old version template
git-upgrade info Add updated files to commit
git-upgrade info Commit old version template
git-upgrade info Install the new version
error Command failed.
Exit code: 128
Command: git
Arguments: clone https://github.com/hiaw/react-native-layout-tester /Users/danielchong/Library/Caches/Yarn/.tmp/c055b13a602c46e87e94ee25168d3eb7
Directory: /Users/danielchong/Documents/Development/Mobile/React-Native/_client/Smish
Output:
fatal: working tree '.' already exists.
git-upgrade ERR! An error occurred during upgrade:
git-upgrade ERR! Error: Command 'yarn add [email protected] react@~15.4.0-rc.4' exited with code 1:
stderr: undefinederror Command failed.
Exit code: 128
Command: git
Arguments: clone https://github.com/hiaw/react-native-layout-tester /Users/danielchong/Library/Caches/Yarn/.tmp/c055b13a602c46e87e94ee25168d3eb7
Directory: /Users/danielchong/Documents/Development/Mobile/React-Native/_client/Smish
Output:
fatal: working tree '.' already exists.
stdout: yarn add v0.18.1
[1/5] Resolving packages...
[2/5] Fetching packages...
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
at ChildProcess.child.on.code (/Users/danielchong/.node/lib/node_modules/react-native-git-upgrade/cliEntry.js:58:18)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191: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 54f0025... Project snapshot
I suspect it has to do with github dependency for react-native-layout-tester?
"devDependencies": {
"babel-jest": "17.0.2",
"babel-preset-react-native": "1.9.0",
"jest": "17.0.3",
"jest-react-native": "17.0.3",
"react-native-components-viewer": "git+https://github.com/hiaw/react-native-components-viewer",
"react-native-layout-tester": "git+https://github.com/hiaw/react-native-layout-tester",
"react-test-renderer": "~15.3.1"
},
upgrade should work flawlessly
+1
I can confirm this issue too while trying to upgrade to RN 0.40.0.
+1
happens when I tried to upgrade from 0.40 to 0.41
It has to do with the Git dependencies indeed. That should be fixed.
In the meantime, just remove them temporary from your package.jsonbefore running "react-native-git-upgrade".
I solved it. For me running yarn instead of npm worked. The steps:
Same here. I just did yarn then react-native-git-upgrade and it worked.
I tried cloning a copy of my old repo (0.42.0), running yarn, and then running react-native-git-upgrade 0.43.0 and still getting fatal: working tree '.' already exists. error. I saw something about removing a package from package.json temporarily? How do you even do that? Looks like react-native-camera may be causing the issue?
{
"name": "Snapshelf",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"firebase": "^3.7.2",
"native-base": "^2.1.1",
"react": "~15.4.1",
"react-native": "0.42.0",
"react-native-animatable": "^1.1.1",
"react-native-camera": "git+https://github.com/lwansbrough/react-native-camera.git",
"react-native-elements": "^0.9.7",
"react-native-fetch-blob": "^0.10.2",
"react-native-vector-icons": "^4.0.0",
"react-redux": "^5.0.3",
"redux": "^3.6.0",
"redux-thunk": "^2.2.0"
},
"devDependencies": {
"babel-jest": "19.0.0",
"babel-plugin-root-import": "^5.1.0",
"babel-preset-react-native": "1.9.1",
"jest": "19.0.2",
"react-test-renderer": "~15.4.1",
"remote-redux-devtools": "^0.5.7"
},
"jest": {
"preset": "react-native"
}
}
i just had to run yarn before git-upgrade and everything is fine :)
Hi there! This issue is being closed because it has been inactive for a while. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. Either way, we're automatically closing issues after a period of inactivity. Please do not take it personally!
If you think this issue should definitely remain open, please let us know. The following information is helpful when it comes to determining if the issue should be re-opened:
If you would like to work on a patch to fix the issue, contributions are very welcome! Read through the contribution guide, and feel free to hop into #react-native if you need help planning your contribution.
git-upgrade info Check for updates
git-upgrade info Using yarn 0.27.5
git-upgrade info Read package.json files
git-upgrade info Check declared version
git-upgrade info Check matching versions
git-upgrade info Check React peer dependency
git-upgrade info Check that Git is installed
git-upgrade info Get information from NPM registry
git-upgrade info Upgrading to React Native 0.47.2, React 16.0.0-alpha.12
git-upgrade info Setup temporary working directory
git-upgrade info Configure Git environment
git-upgrade info Init Git repository
git-upgrade info Add all files to commit
warning: CRLF will be replaced by LF in android/gradlew.bat.
The file will have its original line endings in your working directory.
git-upgrade info Commit current project sources
git-upgrade info Create a tag before updating sources
git-upgrade info Generate old version template
git-upgrade info Add updated files to commit
warning: CRLF will be replaced by LF in android/gradlew.bat.
The file will have its original line endings in your working directory.
git-upgrade info Commit old version template
git-upgrade info Install the new version
error Command failed.
Exit code: 1
Command: git
Arguments: pull
Directory: /Users/Will/Library/Caches/Yarn/v1/.tmp/356e7fb1c51407d4d88112a3cfb3564c
Output:
fatal: 'origin' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
git-upgrade ERR! An error occurred during upgrade:
git-upgrade ERR! Error: Command 'yarn add [email protected]' exited with code 1:
stderr: undefinederror Command failed.
Exit code: 1
Command: git
Arguments: pull
Directory: /Users/Will/Library/Caches/Yarn/v1/.tmp/356e7fb1c51407d4d88112a3cfb3564c
Output:
fatal: 'origin' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
stdout: yarn add v0.27.5
[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 emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:194:7)
at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
Upgrading to 0.47.2 displays the above notice. I've tried clearing the yarn cache without any luck.
I was having the same issue, followed these steps and issue is resolved now:
run command yarn in your project folder and after that run react-native-git-upgrade
I had to both use yarn to reinstall but also remove the following cache folder /Users/jun/Library/Caches/Yarn/v1/.tmp.
Tried using yarn then react-native-git-upgrade without avail (also cleared the cache). I get:
git-upgrade info Install the new version
error Command failed.
Exit code: 128
Command: git
Arguments: clone https://github.com/GeekyAnts/react-native-drawer C:UsersGabrielAppDataLocalYarncachev1.tmp356e7fb1c51407d4d88112a3cfb3564c
Directory: C:UsersGabrielDropboxReactnativechaski-react
Output:
fatal: working tree '.' already exists.
Error: Command failed.
Exit code: 128
Command: git
Arguments: clone https://github.com/GeekyAnts/react-native-keyboard-aware-scroll-view C:UsersGabrielAppDataLocalYarncachev1.tmpa3450fedabcb67009ae55c8f322f57b0
Directory: C:UsersGabrielDropboxReactnativechaski-react
Output:
fatal: working tree '.' already exists.
at MessageError (C:Program Files (x86)Yarnlibcli.js:139:5)
at ProcessTermError (C:Program Files (x86)Yarnlibcli.js:158:1)
at ChildProcess.proc.on (C:Program Files (x86)Yarnlibcli.js:29937:15)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at maybeClose (internal/child_process.js:877:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
git-upgrade ERR! An error occurred during upgrade:
git-upgrade ERR! Error: Command 'yarn add [email protected] [email protected]' exited with code 1:
Most helpful comment
I solved it. For me running yarn instead of npm worked. The steps:
everything is fine!
doing the same with npm didn't work.