Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pod install fails when using pnpm #172

Open
joprice opened this issue Oct 24, 2024 · 4 comments
Open

pod install fails when using pnpm #172

joprice opened this issue Oct 24, 2024 · 4 comments
Labels
help wanted Extra attention is needed

Comments

@joprice
Copy link

joprice commented Oct 24, 2024

When trying to use this project with pnpm, an error like the one below is raised when running pod install. It seems that the relative path used to find the project's root directory will not work with package managers that use symlinks with a global store. Perhaps an env var could be used similar to what's done here https://github.com/pnpm/pnpm/blob/main/workspace/find-workspace-dir/src/index.ts, or simply rely on the current working directory (although this would then assume that you're running the command in the parent directory).

Couldn't install Pods. Updating the Pods project and trying again...
Command `pod install` failed.
└─ Cause: Invalid `Podfile` file:
[!] Invalid `op-sqlite.podspec` file: No such file or directory @ rb_sysopen - <redacted_path>/../../../package.json
@ospfranco
Copy link
Contributor

ospfranco commented Oct 25, 2024

Does this happen with other packages? I don't think metro supports symlinks anyways. In any case, feel free to submit a PR, no time to investigate this myself

@joprice
Copy link
Author

joprice commented Oct 25, 2024

It looks like it was added a while back https://reactnative.dev/blog/2023/06/21/0.72-metro-package-exports-symlinks. But, without configuring that, I had been using pnpm with a react native project for a few weeks until installing this project, so it seems like the unstable flag might not even be needed anymore.

I was wondering how other projects do this, but so far only thought of codegen. Turns out it uses the app_path parameter https://github.com/facebook/react-native/blob/main/packages/react-native/scripts/react_native_pods.rb#L67 to find the package.json config. That pattern requires modifying podfile to pass the arg, so inconvenient. I'm going to poke around at other projects to see if anyone's come up with a convenient patter that works across bundlers. Otherwise, I'll try using an optional env var and falling back to the relative path.

@ospfranco
Copy link
Contributor

ospfranco commented Oct 26, 2024

Oh, I just got it, you mean reading the package.json from the podspec! Ah yeah, op-sqlite is quite unique in that regard. Let me know if you find anything.

@rodebert
Copy link

I am also running into this problem.

@joprice How did you get around it with using an env var? Or are there any other updates how to cope with this? Thanks in advance.

@ospfranco ospfranco added the help wanted Extra attention is needed label Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants