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-doctor has a non fatal error in 51.*.* #28545

Closed
kziemski opened this issue Apr 30, 2024 · 14 comments · Fixed by #28563
Closed

expo-doctor has a non fatal error in 51.*.* #28545

kziemski opened this issue Apr 30, 2024 · 14 comments · Fixed by #28563
Assignees
Labels
CLI Versioned Expo CLI -- `npx expo start` Issue accepted

Comments

@kziemski
Copy link

Summary

npx

expo-doctor

✔ Check Expo config for common issues
✔ Check package.json for common issues
✔ Check native tooling versions
✔ 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 Expo config (app.json/ app.config.js) schema
✖ Check that packages match versions required by installed Expo SDK
...
✖ Check that native modules do not use incompatible support packages
Unexpected error while running 'Check that native modules do not use incompatible support packages' check:
Error: Failed to find dependency tree for @unimodules/core: npm explain @unimodules/core --json exited with non-zero code: 1
✖ Check for legacy global CLI installed locally
Unexpected error while running 'Check for legacy global CLI installed locally' check:
Error: Failed to find dependency tree for expo-cli: npm explain expo-cli --json exited with non-zero code: 1
✔ Check that native modules use compatible support package versions for installed Expo SDK

running those individual commands gives the following:
npm error No dependencies found matching @unimodules/core
{
"error": {
"code": null,
"summary": "No dependencies found matching @unimodules/core",
"detail": ""
}
}

npm error No dependencies found matching expo-cli
{
"error": {
"code": null,
"summary": "No dependencies found matching expo-cli",
"detail": ""
}
}

What platform(s) does this occur on?

Web

SDK Version

51.0.0-preview.8

Environment

expo-env-info 1.2.0 environment info:
System:
OS: Linux 5.15 Ubuntu 22.04.4 LTS 22.04.4 LTS (Jammy Jellyfish)
Shell: 5.1.16 - /bin/bash
Binaries:
Node: 20.12.2 - ~/.nvm/versions/node/v20.12.2/bin/node
Yarn: 4.1.1 - ~/.nvm/versions/node/v20.12.2/bin/yarn
npm: 10.6.0 - ~/.nvm/versions/node/v20.12.2/bin/npm
SDKs:
Android SDK:
API Levels: 34
Build Tools: 33.0.1, 34.0.0
npmGlobalPackages:
eas-cli: 7.8.5
Expo Workflow: managed

Minimal reproducible example

running npx expo-doctor. i don't have a minimal reproducable project as this happens for any project regardless .

@kziemski kziemski added CLI Versioned Expo CLI -- `npx expo start` needs validation Issue needs to be validated labels Apr 30, 2024
@expo-bot expo-bot removed the needs validation Issue needs to be validated label Apr 30, 2024
@brentvatne brentvatne added the incomplete issue: missing or invalid repro A minimal reproducible example is required for most issues label Apr 30, 2024
@expo-bot
Copy link
Collaborator

Hi there! It looks like your issue requires a minimal reproducible example, but it is invalid or absent. Please prepare such an example and share it in a new issue.

The best way to get attention to your issue is to provide a clean and easy way for a developer to reproduce the issue on their own machine. Please do not provide your entire project, or a project with more code than is necessary to reproduce the issue.

A side benefit of going through the process of narrowing down the minimal amount of code needed to reproduce the issue is that you may get lucky and discover that the bug is due to a mistake in your application code that you can quickly fix on your own.

Resources

Common concerns

"I've only been able to reproduce it in private, proprietary code"

You may not have spent enough time narrowing down the root cause of the issue. Try out the techniques discussed in this manual debugging guide to learn how to isolate the problem from the rest of your codebase.

"I didn't have time to create one"

That's understandable, it can take some time to prepare. We ask that you hold off on filing an issue until you are able to fully complete the required fields in the issue template.

"You can reproduce it by yourself by creating a project and following these steps"

This is useful knowledge, but it's still valuable to have the resulting project that is produced from running the steps, where you have verified you can reproduce the issue.

@brentvatne
Copy link
Member

i can't reproduce this. it's possible that you're using an old version of expo-doctor. try npx expo-doctor@latest

@kziemski
Copy link
Author

i just created an sample application using
npx create-expo-app@latest doctor-example
cd doctor-example
npx expo-doctor@latest
the error file is below
error.txt

here is the url that was created https://github.com/kziemski/doctor-example

@outaTiME
Copy link

same here @brentvatne but with Expo 50, I even tried to delete the dependencies and install them again, and I still get the same error.

✔ Check Expo config for common issues
✔ Check package.json for common issues
✔ Check native tooling versions
✔ 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 Expo config (app.json/ app.config.js) schema
✔ Check that packages match versions required by installed Expo SDK
✖ Check that native modules do not use incompatible support packages
Unexpected error while running 'Check that native modules do not use incompatible support packages' check:
Error: Failed to find dependency tree for @unimodules/core: npm explain @unimodules/core --json exited with non-zero code: 1
✖ Check for legacy global CLI installed locally
Unexpected error while running 'Check for legacy global CLI installed locally' check:
Error: Failed to find dependency tree for expo-cli: npm explain expo-cli --json exited with non-zero code: 1
✔ Check that native modules use compatible support package versions for installed Expo SDK
One or more checks failed, indicating possible issues with the project.

I leave a screenshot and expo dependencies:

CleanShot 2024-04-30 at 14 41 18@2x

"expo": "^50.0.18",
"expo-application": "~5.8.4",
"expo-asset": "~9.0.2",
"expo-build-properties": "~0.11.1",
"expo-constants": "~15.4.6",
"expo-dev-client": "~3.3.11",
"expo-device": "~5.9.4",
"expo-file-system": "~16.0.9",
"expo-font": "~11.10.3",
"expo-image": "~1.10.6",
"expo-image-manipulator": "~11.8.0",
"expo-image-picker": "~14.7.1",
"expo-localization": "~14.8.4",
"expo-location": "~16.5.5",
"expo-notifications": "~0.27.7",
"expo-secure-store": "~12.8.1",
"expo-sharing": "~11.10.0",
"expo-splash-screen": "~0.26.5",
"expo-status-bar": "~1.11.1",
"expo-system-ui": "~2.9.4",
"expo-updates": "~0.24.12",

@brentvatne
Copy link
Member

thanks, @keith-kurak will check this out

@expo-bot
Copy link
Collaborator

Thank you for filing this issue!
This comment acknowledges we believe this may be a bug and there’s enough information to investigate it.
However, we can’t promise any sort of timeline for resolution. We prioritize issues based on severity, breadth of impact, and alignment with our roadmap. If you’d like to help move it more quickly, you can continue to investigate it more deeply and/or you can open a pull request that fixes the cause.

@keith-kurak
Copy link
Contributor

I'm having trouble reproducing this locally, as well.

@outaTiME would you be able to confirm your local environment with npx expo-env-info?

@outaTiME and/or @kziemski , could you try one of the underlying commands manually from your terminal, e.g., npm explain expo-cli --json? It seems like that is erroring out, but it's not exposing the error.

At first I thought it was maybe a Node 20/ NPM 10 thing, but I switched to that and still couldn't reproduce.

@kziemski
Copy link
Author

@outaTiME i included it in the original post
running those individual commands gives the following:

npm explain @unimodules/core --json
npm error No dependencies found matching @unimodules/core
{
"error": {
"code": null,
"summary": "No dependencies found matching @unimodules/core",
"detail": ""
}
}

npm explain expo-cli --json
npm error No dependencies found matching expo-cli
{
"error": {
"code": null,
"summary": "No dependencies found matching expo-cli",
"detail": ""
}
}

@outaTiME
Copy link

I'm having trouble reproducing this locally, as well.

@outaTiME would you be able to confirm your local environment with npx expo-env-info?

@outaTiME and/or @kziemski , could you try one of the underlying commands manually from your terminal, e.g., npm explain expo-cli --json? It seems like that is erroring out, but it's not exposing the error.

At first I thought it was maybe a Node 20/ NPM 10 thing, but I switched to that and still couldn't reproduce.

Yes, for sure, here is the output of the npx expo-env-info:

  expo-env-info 1.2.0 environment info:
    System:
      OS: macOS 14.4.1
      Shell: 5.9 - /bin/zsh
    Binaries:
      Node: 18.19.1 - ~/Library/Caches/fnm_multishells/59574_1714494219098/bin/node
      Yarn: 4.1.1 - ~/Library/Caches/fnm_multishells/59574_1714494219098/bin/yarn
      npm: 10.6.0 - ~/Library/Caches/fnm_multishells/59574_1714494219098/bin/npm
      Watchman: 2024.04.22.00 - /opt/homebrew/bin/watchman
    Managers:
      CocoaPods: 1.14.3 - /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
    IDEs:
      Android Studio: 2023.2 AI-232.10300.40.2321.11668458
      Xcode: 15.3/15E204a - /usr/bin/xcodebuild
    npmPackages:
      expo: ^50.0.18 => 50.0.18 
      react: 18.2.0 => 18.2.0 
      react-native: 0.73.6 => 0.73.6 
    npmGlobalPackages:
      eas-cli: 7.8.5
    Expo Workflow: managed

and on the other hand, here is the output of npm explain expo-cli -json:

npm error No dependencies found matching expo-cli
{
  "error": {
    "code": null,
    "summary": "No dependencies found matching expo-cli",
    "detail": ""
  }
}

npm error A complete log of this run can be found in: /Users/outaTiME/.npm/_logs/2024-04-30T22_11_36_429Z-debug-0.log

I hope it will be useful 🙏

@keith-kurak
Copy link
Contributor

@kziemski ah, sorry I missed that before! Thanks for providing it again, and thanks for your output, as well, @outaTiME !

It looks like we try to match on "npm ERR!", but your npm explain is returning "npm error". We could match on both, but I'm going to try to look around to figure out what could cause that output to change.

@keith-kurak keith-kurak removed the incomplete issue: missing or invalid repro A minimal reproducible example is required for most issues label Apr 30, 2024
@kziemski
Copy link
Author

oh then its definitely npm@10.6.0. i regularly run nvm install-latest-npm so i probably caught a later version.

keith-kurak added a commit that referenced this issue May 1, 2024
# Why

Fixes #28545, which presents itself
on the most recent NPM versions. Somewhere between 10.2 and 10.6, the
stderr prefix changed from `npm ERR!` to `npm error`. The deep
dependency check code was matching on `/npm ERR! No dependencies found
matching/` to detect that there's no matching dependencies, so it broke
all deep dep checks on these later versions.

# How
Changed the match to `/No dependencies found matching/`. Since we
request the JSON output from `npm explain`, which also identifies that
no results, thought about going after that, but it's really just
matching against the same string, so

Example:
```
npm explain expo-cli --json
npm error No dependencies found matching expo-cli
{
  "error": {
    "code": null,
    "summary": "No dependencies found matching expo-cli",
    "detail": ""
  }
}
```

Also added some debug logging to the `explainDependencies` code so we
can get a little more info if these commands fail in the future (there's
been other hard-to-detect issues before due to node setup weirdness).

# Test Plan
No more errors on those checks with npm 10.7:
<img width="658" alt="image"
src="https://github.com/expo/expo/assets/8053974/43b817fc-3e60-4aff-88a4-0409eab2417b">

No errors on those checks still with npm 10.7
<img width="656" alt="image"
src="https://github.com/expo/expo/assets/8053974/f2512a10-b76f-47d3-b560-f16bf817a0bc">

Also, still picks up issues if I install one of the dependencies those
checks detects.

# Checklist

<!--
Please check the appropriate items below if they apply to your diff.
This is required for changes to Expo modules.
-->

- [ ] Documentation is up to date to reflect these changes (eg:
https://docs.expo.dev and README.md).
- [ ] Conforms with the [Documentation Writing Style
Guide](https://github.com/expo/expo/blob/main/guides/Expo%20Documentation%20Writing%20Style%20Guide.md)
- [ ] This diff will work correctly for `npx expo prebuild` & EAS Build
(eg: updated a module plugin).
@keith-kurak
Copy link
Contributor

fix should be live now!

@kziemski
Copy link
Author

kziemski commented May 1, 2024

👍
Confirm Fixed.

npx expo-doctor@latest
Need to install the following packages:
expo-doctor@1.6.0
Ok to proceed? (y) y

@cmat-cmon-app/site@1.0.0 npx
expo-doctor

✔ Check Expo config for common issues
✔ Check package.json for common issues
✔ Check native tooling versions
✔ 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 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

Detailed check results:

The following packages should be updated for best compatibility with the installed expo version:
...
..
Your project may not work correctly until you install the expected versions of the packages.
Found outdated dependencies
Advice: Use 'npx expo install --check' to review and upgrade your dependencies.

One or more checks failed, indicating possible issues with the project.

@kziemski
Copy link
Author

kziemski commented May 1, 2024

@keith-kurak if you're possibly on the discord can you check my related issue to this? I don't know if this is an expo problem i need to report or if its the package owner's issue. Tried to follow the code for "--check" and doctor but not sure where it get thats info.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLI Versioned Expo CLI -- `npx expo start` Issue accepted
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants