Skip to content

fix(v2/doctor): stop reporting an installed npm as missing on Linux - #6212

Open
somaz94 wants to merge 1 commit into
wailsapp:masterfrom
somaz94:bugfix/5842_doctor-npm-not-found
Open

somaz94 wants to merge 1 commit into
wailsapp:masterfrom
somaz94:bugfix/5842_doctor-npm-not-found

Conversation

@somaz94

@somaz94 somaz94 commented Oct 2, 2026 •

Copy link
Copy Markdown

Description

When the package manager does not report a dependency, discover() on Linux falls back to a local check (npm -version, makensis -VERSION and so on), but it only copied Installed and Version from the result. doctor.go decides the status from PackageName, so a dependency the package manager does not list at all stayed Not Found, and a required one failed the diagnosis. In the issue that is npm, because the image removes /var/lib/apt/lists.

The local check now also fills in PackageName ("N/A", which doctor already shows for npm on Windows and macOS) when the package manager had none, and keeps the package manager's name otherwise. The nsis check had the same gap and goes through the same helper.

The libgtk-3 and libwebkit rows showing Available in the issue are a separate problem (apt list marks them [installed,local] once the lists are gone), tracked in #4258 with a draft fix in #5184.

Fixes #5842

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • WEP (proposal only; no implementation)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

  • New unit tests in v2/internal/system/system_linux_test.go (the case for a dependency only the local check finds fails on master)
  • wails doctor from master and from this branch in an ubuntu:22.04 container set up like the one in the issue

On master that container shows npm as Unknown, Not Found and ends with "Required dependencies missing: npm". With this branch npm shows as N/A, Installed and the Fatal line is gone (output below).

  • Windows
  • macOS
  • Linux

Ubuntu 22.04 (arm64 container) with NodeSource Node 24, libgtk-3-dev and libwebkit2gtk-4.0-dev installed and the apt lists removed, Go 1.25.14. go test ./... in v2 passes there.

Test Configuration

          Wails Doctor          

# Wails
┌────────────────────────────────────────────────────────────┐
| Version         | v2.16.0                                  |
| Revision        | 75918861d85d9136e368ee7edb896d665fe092e2 |
| Modified        | false                                    |
| Package Manager | apt                                      |
└────────────────────────────────────────────────────────────┘

# System
┌──────────────────────────┐
| OS           | Ubuntu    |
| Version      | 22.04     |
| ID           | ubuntu    |
| Branding     |           |
| Go Version   | go1.25.14 |
| Platform     | linux     |
| Architecture | arm64     |
| CPU          |           |
| GPU          | Unknown   |
| Memory       | 11GB      |
└──────────────────────────┘

# Dependencies
┌──────────────────────────────────────────────────────────────────────────┐
| Dependency | Package Name          | Status    | Version                 |
| *docker    | Unknown               | Not Found |                         |
| gcc        | build-essential       | Installed | 11.4.0                  |
| libgtk-3   | libgtk-3-dev          | Available | 3.24.33-1ubuntu2.2      |
| libwebkit  | libwebkit2gtk-4.0-dev | Available | 2.50.4-0ubuntu0.22.04.1 |
| npm        | N/A                   | Installed | 11.19.0                 |
| *nsis      | Unknown               | Not Found |                         |
| pkg-config | pkg-config            | Installed | 0.29.2                  |
|                                                                          |
└──────────────────────── * - Optional Dependency ─────────────────────────┘

# Diagnosis
Required package(s) installation details: 
  - libgtk-3: sudo apt install libgtk-3-dev
  - libwebkit: sudo apt install libwebkit2gtk-4.0-dev

 WARNING  Your system has missing dependencies!

Checklist:

  • (v2 only) I have updated website/src/pages/changelog.mdx with details of this PR (v3 changelog entries are added automatically)
  • My code follows the general coding style of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Summary by CodeRabbit

  • Bug Fixes
    • Fixed wails doctor incorrectly reporting npm as missing on Linux when it is installed locally but not listed by the package manager.
    • Improved Linux dependency checks to report locally installed dependency versions and package names accurately.

@coderabbitai

coderabbitai Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: wailsapp/wails/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 61cbc1b2-7c36-4007-a52a-3c2f53470bb3

📥 Commits

Reviewing files that changed from the base of the PR and between 90486a9 and 7591886.

📒 Files selected for processing (3)
  • v2/internal/system/system_linux.go
  • v2/internal/system/system_linux_test.go
  • website/src/pages/changelog.mdx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.


Walkthrough

Linux local dependency checks now use a shared helper to apply installation status, version, and package name. Tests cover the check results, and the Unreleased changelog records the npm detection issue.

Changes

Linux local dependency detection

Layer / File(s) Summary
Apply and verify local dependency results
v2/internal/system/system_linux.go, v2/internal/system/system_linux_test.go, website/src/pages/changelog.mdx
checkLocallyInstalled and the NSIS check use applyLocalCheck to apply local installation details. Tests cover local and package-manager results. The changelog records the Linux npm detection fix.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Low

Merge Risk: ⚪ Minimal · up to 75918

No actionable merge-blocking issue remains; the Linux dependency-detection fix is ready for normal merge checks.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 2 files. (1 skipped: 1 … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the v2 doctor bug fix and the Linux npm detection issue.
Description check ✅ Passed The description is complete. It explains the issue, fix, scope, linked issue, testing environment, test results, changelog update, and checklist status.
Linked Issues check ✅ Passed Issue #5842 requires Linux wails doctor to accept the locally available Node package tooling when the package manager has no package name. checkLocallyInstalled now applies the local result, copie…
Out of Scope Changes check ✅ Passed The changed Linux system code directly implements the #5842 fix. The Linux tests verify that behavior. The changelog documents the same fix. The NSIS use of the shared helper is related refactoring fo…
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 2 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.

Warning

Some tools did not complete. Review the errors below.

🔧 golangci-lint (2.13.2)

golangci-lint (2.13.2) skipped for v2/.golangci.yml: configuration requires version: "2". Migrate older configurations using golangci-lint migrate and review the result; see https://golangci-lint.run/docs/product/migration-guide/.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

A rabbit checks the Linux trail,
And finds the package without fail.
It marks the version, name, and state,
So npm checks can get it straight.
Then hops away, ears held high,
Beneath a clear and truthful sky.

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added Bug Something isn't working v2 Documentation Improvements or additions to documentation Linux labels Oct 2, 2026
@somaz94
somaz94 marked this pull request as ready for review October 2, 2026 07:59
somaz94 added a commit to somaz94/somaz94 that referenced this pull request Oct 2, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something isn't working Documentation Improvements or additions to documentation Linux v2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

wails doctor does not recognize pnpm

1 participant