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

Expo SDK 51 - RN 0.74.1 - Error: Cannot find module 'expo/package.json' | Invalid Podfile file: cannot load such file -- ./scripts/autolinking. #28824

Open
dziter opened this issue May 14, 2024 · 5 comments
Assignees
Labels
needs more info To be used when awaiting reporter response

Comments

@dziter
Copy link

dziter commented May 14, 2024

Minimal reproducible example

https://github.com/dziter/expo-local-auth

What platform(s) does this occur on?

iOS

Did you reproduce this issue in a development build?

No (only happens in a standalone build)

Summary

Since I have updated to Expo SDK 51, my Github Action CI for iOS build is KO. I did extensive debug but I do not find the reason. Please note that it is working locally on my machine. Also, it was working perfectly before the upgrade for Expo 51 SDK.
I have also investigated in the direction of yarn berry
Android is fine.

I get this error:

Run cd ios
  cd ios
  pod repo update
  pod install
  cd ..
  shell: /bin/bash -e {0}
  env:
    PATH: /Users/runner/hostedtoolcache/node/[2](https://github.com/ifeelgoods/gift-cool/actions/runs/9075841840/job/24937279316#step:15:2)2.1.0/arm64/bin:/Users/runner/.local/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/Users/runner/.cargo/bin:/usr/local/opt/curl/bin:/usr/local/bin:/usr/local/sbin:/Users/runner/bin:/Users/runner/.yarn/bin:/Users/runner/Library/Android/sdk/tools:/Users/runner/Library/Android/sdk/platform-tools:/Library/Frameworks/Python.framework/Versions/Current/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/usr/bin:/bin:/usr/sbin:/sbin:/Users/runner/.dotnet/tools
  
node:internal/modules/cjs/loader:1227
  throw err;
  ^
Error: Cannot find module 'expo/package.json'
Require stack:
- /Users/runner/work/gift-cool/gift-cool/ios/[eval]
    at Module._resolveFilename (node:internal/modules/cjs/loader:1224:15)
    at Function.resolve (node:internal/modules/helpers:190:19)
    at [eval]:1:9
    at runScriptInThisContext (node:internal/vm:209:10)
    at node:internal/process/execution:118:14
    at [eval]-wrapper:6:24
    at runScript (node:internal/process/execution:101:62)
    at evalScript (node:internal/process/execution:1[3](https://github.com/ifeelgoods/gift-cool/actions/runs/9075841840/job/24937279316#step:15:3)6:3)
    at node:internal/main/eval_string:[5](https://github.com/ifeelgoods/gift-cool/actions/runs/9075841840/job/24937279316#step:15:5)1:3 {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ '/Users/runner/work/gift-cool/gift-cool/ios/[eval]' ]
}
Node.js v22.1.0
[!] Invalid `Podfile` file: cannot load such file -- ./scripts/autolinking.
 #  from /Users/runner/work/gift-cool/gift-cool/ios/Podfile:3
 #  -------------------------------------------
 #  
 >  require File.join(File.dirname(`node --print "require.resolve('expo/package.json')"`), "scripts/autolinking")
 #  
 #  -------------------------------------------
Error: Process completed with exit code 1.

The error comes from Podfile:
require File.join(File.dirname(node --print "require.resolve('expo/package.json')"), "scripts/autolinking")

Environment

expo-env-info 1.2.0 environment info:
System:
OS: macOS 14.4.1
Shell: 5.9 - /bin/zsh
Binaries:
Node: 21.6.2 - ~/.nvm/versions/node/v21.6.2/bin/node
Yarn: 4.2.1 - ~/.yarn/bin/yarn
npm: 10.2.4 - ~/.nvm/versions/node/v21.6.2/bin/npm
Watchman: 2023.09.25.00 - /opt/homebrew/bin/watchman
Managers:
CocoaPods: 1.15.2 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 23.4, iOS 17.4, macOS 14.4, tvOS 17.4, visionOS 1.1, watchOS 10.4
Android SDK:
API Levels: 26, 27, 28, 29, 30, 31, 32, 33, 34
Build Tools: 29.0.2, 29.0.3, 30.0.2, 30.0.3, 31.0.0, 32.0.0, 33.0.0, 33.0.0, 33.0.1, 34.0.0, 35.0.0
System Images: android-32 | Google APIs ARM 64 v8a, android-32 | Google Play ARM 64 v8a, android-32 | Google Play Intel x86 Atom_64
Android NDK: 22.1.7171670
IDEs:
Android Studio: 2022.3 AI-223.8836.35.2231.11005911
Xcode: 15.3/15E204a - /usr/bin/xcodebuild
npmPackages:
expo: ^51.0.0 => 51.0.5
react: 18.2.0 => 18.2.0
react-dom: 18.2.0 => 18.2.0
react-native: 0.74.1 => 0.74.1
Expo Workflow: bare

Expo Doctor Diagnostics

✔ Check Expo config for common issues
✔ Check package.json for common issues
✔ Check dependencies for packages that should not be installed directly
✔ Check for common project setup issues
✔ Check for issues with metro config
✔ Check npm/ yarn versions
✔ Check native tooling versions
✔ Check Expo config (app.json/ app.config.js) schema
✔ Check that packages match versions required by installed Expo SDK
✔ Check for legacy global CLI installed locally
✔ Check that native modules do not use incompatible support packages
✔ Check that native modules use compatible support package versions for installed Expo SDK

Didn't find any issues with the project!

@dziter dziter added the needs validation Issue needs to be validated label May 14, 2024
@expo-bot expo-bot added needs review Issue is ready to be reviewed by a maintainer and removed needs validation Issue needs to be validated labels May 14, 2024
@byCedric
Copy link
Member

Hi @dziter, thanks for the issue report. Can you also share a repository where this error occurs in GitHub Actions? The line that you point to is an important one for Expo's autolinking, and should work as expected. It's weird that Node can't find expo/package.json, as the expo package should be installed.

Without that repository, there is not much we can do to help.

@byCedric byCedric self-assigned this May 14, 2024
@byCedric byCedric added needs more info To be used when awaiting reporter response and removed needs review Issue is ready to be reviewed by a maintainer labels May 14, 2024
@dziter
Copy link
Author

dziter commented May 14, 2024

@byCedric : Thank you for your reply.

I just created a fresh project for you to reproduce the issue:
https://github.com/dziter/expo-local-auth

@dziter
Copy link
Author

dziter commented May 21, 2024

@byCedric : Any news about it? Did you reproduce? Thanks.

@alainib
Copy link

alainib commented May 27, 2024

hello
any news on this blocking problem please ?

@dziter
Copy link
Author

dziter commented May 27, 2024

Hi @alainib,

I still have the issue on my side. I tried to upgrade minor expo version last time, unfortunately it did not change anything.

@byCedric : Did you get the occasion to look at this issue?
Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs more info To be used when awaiting reporter response
Projects
None yet
Development

No branches or pull requests

4 participants