Reference to absoulte path in resulting .exe file -> unable to run on different system
See original GitHub issueDescribe the bug A clear and concise description of what the bug is.
To Reproduce Steps to reproduce the behavior:
- Clone https://github.com/digaus/capacitor-plugin-demo
- run
npm install
- run
npm run build -- --prod
- run
npx cap sync @capacitor-community/electron
- run
npm run electron:build-windows
inside electron folder - Install .exe on a different System
- Start .exe via Command Line Tool to see error
Following error occurs:
(node:12460) UnhandledPromiseRejectionWarning: Error: Cannot find module 'C:\Users\User\Documents\Git\capacitor-plugin-demo\electron\node_modules\@digaus\file-server\electron\dist\plugin.js'
Require stack:
- C:\Users\digau\AppData\Local\Programs\capacitor-plugin-demo\resources\app.asar\node_modules\@capacitor-community\electron\dist\runtime\electron-plugins.js
- C:\Users\digau\AppData\Local\Programs\capacitor-plugin-demo\resources\app.asar\node_modules\@capacitor-community\electron\dist\core\util.js
- C:\Users\digau\AppData\Local\Programs\capacitor-plugin-demo\resources\app.asar\node_modules\@capacitor-community\electron\dist\core\index.js
- C:\Users\digau\AppData\Local\Programs\capacitor-plugin-demo\resources\app.asar\build\src\index.js
-
at Module._resolveFilename (internal/modules/cjs/loader.js:887:15)
at Function.n._resolveFilename (electron/js2c/browser_init.js:257:1128)
at Module._load (internal/modules/cjs/loader.js:732:27)
at Function.f._load (electron/js2c/asar_bundle.js:5:12913)
at Module.require (internal/modules/cjs/loader.js:959:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object.<anonymous> (C:\Users\digau\AppData\Local\Programs\capacitor-plugin-demo\resources\app.asar\node_modules\@capacitor-community\electron\dist\runtime\electron-plugins.js:2:26)
at Module._compile (internal/modules/cjs/loader.js:1078:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1108:10)
at Module.load (internal/modules/cjs/loader.js:935:32)
(Use `Capacitor App --trace-warnings ...` to show where the warning was created)
(node:12460) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:12460) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Expected behavior App should run normally and not reference an absolute path.
Desktop (please complete the following information):
- OS: Windows 10
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:9 (7 by maintainers)
Top Results From Across the Web
11 Ways to Fix "The System Cannot Find The Path Specified ...
1. Run Command Prompt as an Administrator · 2. Ensure the File Isn't Password Protected · 3. Check Your System for Viruses ·...
Read more >pyinstaller exe identifiies relative paths but not absolute path
To create Exe I run cmd commands from Exe directory. pyinstaller -F -i ABC.ico "..\src\scriptabc.py". The resulting files are correctly ...
Read more >File path formats on Windows systems | Microsoft Learn
An absolute file path from the root of drive C: . \Program Files\Custom Utilities\StringFinder.exe, A relative path from the root of the current ......
Read more >Issues When Using auto-py-to-exe - Nitratine
After helping many of people fix issues with auto-py-to-exe and ... The file cannot be accessed by the system; The exe Runs But...
Read more >Relative and absolute paths, in the file system and on the web ...
Both web-server and file system are doing that but different ways. ... And if you try to use it in PHP it will...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Submitted a PR to your repo
Issue fixed in #151 by @jdgjsag67251 🎉