System: Windows 10 64 bit
I am trying to build a JavaScript project using yarn install --lock-file
in the repository directory. When yarn tries to fetch the packages, it fails with the following error message:
Exit code: 128 Command: git Arguments: pull Directory: C:\Users\[UserDirectory]\AppData\Local\Yarn\Cache\v2.tmp\9f5ed3b3940e461693021bf6d9a7805d Output: fatal: not a git repository (or any of the parent directories): .git
I cannot figure out why yarn is trying to use git pull in another directory. Can you explain me what yarn is doing here?
Edit:
At first, I guessed it must be an issue with access rights, but running it with elevated access gave the same result. The same goes for yarn install
, so without the --frozen-lockfile
flag.
System: Windows 10 64 bit
I am trying to build a JavaScript project using yarn install --lock-file
in the repository directory. When yarn tries to fetch the packages, it fails with the following error message:
Exit code: 128 Command: git Arguments: pull Directory: C:\Users\[UserDirectory]\AppData\Local\Yarn\Cache\v2.tmp\9f5ed3b3940e461693021bf6d9a7805d Output: fatal: not a git repository (or any of the parent directories): .git
I cannot figure out why yarn is trying to use git pull in another directory. Can you explain me what yarn is doing here?
Edit:
At first, I guessed it must be an issue with access rights, but running it with elevated access gave the same result. The same goes for yarn install
, so without the --frozen-lockfile
flag.
- I guess it is not a git problem? maybe you could remove the git tag then – OznOg Commented Oct 14, 2018 at 9:40
- @OznOg I was not entirely sure, as I do not pletely understand what is happing this point. But I guess you are right to exclude a misbehavior in git? – Mygeen Commented Oct 14, 2018 at 10:15
- well git error is clear, you are atempting to perform a git pull in a directory which is not a git directory (ie, git cannot find its metadata in the .git subdirectory that should be there) – OznOg Commented Oct 14, 2018 at 10:17
- Yes, true.Removed it – Mygeen Commented Oct 14, 2018 at 10:42
2 Answers
Reset to default 14I was getting the same error in a repo of mine too for any Yarn mand.
Removing the Yarn Cache fixed Yarn for me: yarn cache clean
(remended) or
rm -rf C:\Users\<user>\AppData\Local\Yarn\Cache\v2.tmp\<hash> # the older hacky way
if someone still can't solve the problem, can try git init