-
Notifications
You must be signed in to change notification settings - Fork 1
Description
I have added require('win-ca') at the top of the main.js file. It works fine when I am running the application from VS Code and when the modules are left unpacked. As part of the build process I am packaging electron using asar, i.e. with "build":{"asar": true}" in package.json. When I run it this way I am getting the following error.
Stack: Error: spawn path\to\electron\resources\app.asar\node_modules\win-ca\lib\roots ENOENT
at exports._errnoException (util.js:1024:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:192:19)
at onErrorNT (internal/child_process.js:374:16)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickCallback (internal/process/next_tick.js:180:9)
at Function.Module.runMain (module.js:607:11)
at startup (bootstrap_node.js:167:16)
at bootstrap_node.js:589:3
I believe this is due to permission issues since the file exists. I've also tried
require('win-ca/fallback') with the same result.
I also noticed app.asar.unpacked directory is also created with win-ca inside. When I try to explicitly use this, i.e. require('path\to\electron\resources\app.asar.unpacked\node_modules\win-ca'), I get the following error.
Stack: Error: Cannot find module 'split'
My question is am I importing the package correctly given the way my app is set up? Have you run into this issue and know of a way to correctly implement?