bug: Unable to run `pnpm dev` in expo due to `.gitignore`
adamspotlite opened this issue · comments
Provide environment information
System:
OS: Linux 6.5 Ubuntu 22.04.3 LTS 22.04.3 LTS (Jammy Jellyfish)
CPU: (20) x64 12th Gen Intel(R) Core(TM) i9-12900HK
Memory: 44.39 GB / 62.47 GB
Container: Yes
Shell: 3.3.1 - /usr/bin/fish
Binaries:
Node: 21.6.0 - ~/.local/share/nvm/v21.6.0/bin/node
npm: 10.2.4 - ~/.local/share/nvm/v21.6.0/bin/npm
pnpm: 8.11.0 - ~/.local/share/pnpm/pnpm
Describe the bug
Upon downloading the template, I'm unable to run pnpm dev
in apps/expo
. I receive the following permissions error due to the .gitignore
:
Starting Metro Bundler
Error: EACCES: permission denied, open '/home/learning-projects/t3-test/apps/expo/.gitignore'
at Object.readFileSync (node:fs:456:20)
at Object.upsertGitIgnoreContents (/home/learning-projects/t3-test/node_modules/@expo/cli/src/utils/mergeGitIgnorePaths.ts:121:30)
at Object.startTypescriptTypeGenerationAsync (/home/learning-projects/t3-test/node_modules/@expo/cli/src/start/server/type-generation/startTypescriptTypeGeneration.ts:51:85)
Link to reproduction
https://github.com/t3-oss/create-t3-turbo
To reproduce
npx create-turbo@latest -e https://github.com/t3-oss/create-t3-turbo
cd repo_name
pnpm i
cd apps/expo
pnpm dev
Additional information
No response
same issue here and don want to execute with sudo
Hi, I had the same issue. It looks like the .gitignore
file gets generated without any rwx permissions. I fixed the issue by deleting the file and creating an empty /apps/expo/.gitignore
file. The file should get updated automatically once you run pnpm dev
again.
Can you please verify that this doesnt happen on a normal expo app? I dont see why this would be a cause of t3 turbo so this issue should likely be opened upstream?
It works for me with a normal expo app. An intact .gitignore
file gets generated with the cli: npx create-expo-app my-app
.
btw thanks for your open source contributions
It works for me with a normal expo app. An intact
.gitignore
file gets generated with the cli:npx create-expo-app my-app
.btw thanks for your open source contributions
And if you delete that file and run pnpm dev again? I'm guessing that the create-expo cli is copyinh some template file at init with proper permisssions but then the dev server writes with different ones?
I deleted the .gitignore
file and it does not get generated again. I used npm run ios
instead of pnpm dev
, because the default expo app comes with npm.
I want to report I have the same issue and I fix the issue by adding file permissions to the .gitignore and running pnpm run dev
I can confirm that this is not a unique T3 issue, I get the same in an NX monorepo
Does anyone know where to put this then? I feel like the proper steps are:
- Close this issue
- Make a note somewhere that there is a solution to the solution (namely, running
chmod 644 apps/expo/.gitignore
) - Add a new issue in one of the
expo-cli
repos
Is there anything wrong with just manually adding a .gitignore
file to the expo directory as @AMayer1997 mentioned here
Hi, I had the same issue. It looks like the
.gitignore
file gets generated without any rwx permissions. I fixed the issue by deleting the file and creating an empty/apps/expo/.gitignore
file. The file should get updated automatically once you runpnpm dev
again.
@psycho-baller not that I can tell - I think that's likely what most folks end up doing (myself included), without any downstream implications.
Does anyone know where to put this then? I feel like the proper steps are:
- Close this issue
- Make a note somewhere that there is a solution to the solution (namely, running
chmod 644 apps/expo/.gitignore
)- Add a new issue in one of the
expo-cli
repos
@juliusmarminge should i go through with this? I don't think this needs to be an active issue, but I feel it should be documented for future reference.
I opened an issue right after expo started generating gitignore that got converted to discussion (see expo/router#846)
I bumped that to see if they want a new issue or not. Either way I think we can keep this issue open just for visibility until they have fixed it on there part.
Happening to me as well
OS : Windows 11
go to apps/expo/ and run following command. I will suggest 2nd one because it worked for me.
icacls .gitignore /grant %username%:F
orattrib -r .gitignore