-
-
Notifications
You must be signed in to change notification settings - Fork 521
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
With no changes, "Cannot find module 'appdmg'" #3371
Comments
Looks like the |
Hello, I have the same issue and would like to add some insight I gained while losing my sanity while investigating this issue. I encountered this issue while working on chainner. I noticed that this Github actions workflow suddenly started failing on macOS when I changed a file totally unrelated to the workflow. I got the same error message as @busterbogheart:
While investigating this issue, I found 2 main things: Firstly, the issue is definitely related to caches. Removing the Secondly, I noticed the logs of all successful and failed builds were identical until the [SUCCESS] Running prePackage hook from forgeConfig
[STARTED] [plugin-webpack] Preparing native dependencies
[TITLE] [plugin-webpack] Preparing native dependencies
-[TITLE] [plugin-webpack] Preparing native dependencies: 0 / 1
-[TITLE] [plugin-webpack] Preparing native dependencies: 1 / 1
-[SUCCESS] [plugin-webpack] Preparing native dependencies: 1 / 1
+[SUCCESS] [plugin-webpack] Preparing native dependencies
[STARTED] [plugin-webpack] Building webpack bundles
[SUCCESS] [plugin-webpack] Building webpack bundles
[SUCCESS] Running prePackage hook
@@ -68,6 +66,55 @@
[SUCCESS] Running preMake hook
[STARTED] Making distributables
[STARTED] Making a dmg distributable for darwin/universal
-[SUCCESS] Making a dmg distributable for darwin/universal
+[FAILED] Cannot find module 'appdmg'
+[FAILED] Require stack:
+[FAILED] - /Users/runner/work/chaiNNer/chaiNNer/node_modules/electron-installer-dmg/src/index.js
+[FAILED] - /Users/runner/work/chaiNNer/chaiNNer/node_modules/@electron-forge/maker-dmg/dist/MakerDMG.js
+... As we can see, the successful runs always prepare one native dependency, while the failed runs do not. This native dependency is specific to macOS (my windows and linux runs never have it), so I suspect that |
I'm having this issue randomly also with GitHub actions. 1 hour to develop a new feature, 6+ hours trying to fix an npm issue :) The issue seems to be with
I can't figure out why it's not including appdmg. I've tried updating forge.config to not use the cache, and to use appdmg as a forced module to rebuild:
I've added appdmg as a devdependency directly. I've updated electron-forge and all libraries to the latest versions. I've updated GitHub actions to check if it's now returning different OS platform details so the
I've changed it to Nothing helps/works 😭 |
After removing Windows from my matrix the OSX build succeeds consistently 🤔 |
@ashleyhindle if you're cachingnode_modules in any way the cache key needs to include platform, otherwise it sounds like you're restoring a cached set of windows node_modules onto your macos runner which won't have appdmg set up because that module is only installed on macos hosts |
Unfortunately I don't cache |
This is happening in my GitHub actions as well, Ive found that it correlates to the version of the Github runner. macos-12: 20231029.1 causes a failure |
This issue happened to me today.
npm i appdmg --save-optional
Edit: It started failing again on the next build. |
I am having this issue as well, not sure if I have anything meaningful to contribute as far as data points go. |
Hope the above helps those using github workflows. It seems to be caused by python. |
@1000TurquoisePogs I end up with another issue after I've configured CI to install
I'm pretty sure this relates to LinusU/node-appdmg#130, although it is not an upstream error. It seems Forge should be the one taking care of cleanup and it's a problem in Forge it picks the path where it isn't possible to write to a file (since another file already exists there). Moreover, the overwrite flag that is announced in the upstream issue and PR seems to be an optional in the future and possibly set to Also, it is still failing for me on CI re-runs with older source code and lockfile (with both |
Had the same issue on Mac. After hrs of tinkering, I tried to install the package manually via pyenv global 3.11.4 And its working fine now. Hope this helps anyone else. |
Here is the fix if you want to keep 3.12 (github action default python versions) LinusU/node-appdmg#234 |
It looks like GHA mac runner has installed brew and python in some new way which is now giving an error. The New error:
|
Thanks! It works for me: - name: Install Python 3.11.4
uses: actions/setup-python@v4
with:
python-version: '3.11.4' |
If using GitHub Actions with the - name: Set up Python for appdmg to be installed
run: brew install python-setuptools |
Got this locally after upgrading Python via Homebrew. The fix for me was:
Then the build worked. |
Any updates on that matter? I have two runners, macos-latest and macOS-13, both updated to LTS Node (22), but it's not working anymore. This solution was previously effective for me with Node 20:
|
Pre-flight checklist
Electron Forge version
6.4.1
Electron version
v24.8.1
Operating system
macOS 11.3.1
Last known working Electron Forge version
6.1.1
Expected behavior
Our build is running in Circle CI, and without changes recently this issue happens. We've tried pegging the
@electron-forge
modules to 6.1.1, but the issue remains.Any recent changes in forge that could cause the
Cannot find module 'appdmg'
error?Actual behavior
The text was updated successfully, but these errors were encountered: