turbo: ERROR failed to calculate global hash: error hashing files
What version of Turborepo are you using?
1.2.4
What package manager are you using / does the bug impact?
npm
What operating system are you using?
Mac
Describe the Bug
I keep getting this error when trying to deploy turborepo on vercel
ERROR failed to calculate global hash: error hashing files. make sure that
git has been initialized failed to hash files/vercel/path0/package.json,
/vercel/path0/package-lock.json: git hash-object exited with status: exit status 128
Expected Behavior
Get a succesful deployment
To Reproduce
I have set up this command on Vercel
cd ../.. && npx turbo run build --filter=medusa-admin --include-dependencies --no-deps
And my turborepo is set uo like this
{
"pipeline": {
"build": {
"dependsOn": [
"^build",
"$GATSBY_MEDUSA_BACKEND_URL"
],
"outputs": ["public/**"]
},
"lint": {
"outputs": []
},
"dev": {
"cache": false
}
}
}
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 7
- Comments: 33 (9 by maintainers)
Same issue with 1.2.5, it only happens on the CI.
I’ve downgraded to 1.2.3 and it fixes the issue, so this seems to be a regression introduced in 1.2.4.
Still a problem for me in
1.2.16. After using the quickstart instructions, I receive:Same problem when using pnpm with turborepo when running a turbo command (
turbo run ...) inside a Dockerfile.Same here when I try to run
npm run buildon dockerI downgraded to version 1.2.3 and it’s working.
Hi, I am having the same issue. I already tried running the command with latest v1.2.8 of Turborepo and still showing:
I think the problem started after I deleted the node_modules folder and the package-lock.json file to change my package manager to yarn. However, I have already commited my changes in git and still showing the error. When deploying to Vercel I get the same error:
My local setup is:
git version 2.30.1 (Apple Git-130) I am on a MacOS Monterey (v12.2)
From one day to the next i had the same Issue in 1.1.6 without changing something -> upgraded to 1.2.3 but it remains.
ERROR failed to calculate global hash: error hashing files. make sure that git has been initialized failed to hash files /store/package.json, /store/package-lock.json: git hash-object exited with status: exec: "git": executable file not found in $PATHedit:
So i found out, that when i install git on the docker image in creating it works now.
RUN apk add gitafter upgrade from 1.2.3 to 1.4.6, it happens.
1.2.3 works fine.
Same here when I try to run npm run build on ci gitlab (with turborepo v1.2.6).
I downgraded to version v1.2.3 and it’s working.