简体   繁体   中英

electron-packager and electron-builder error build with electron-vue when put in file server

I'm building an Electron-Vue application from GREG boilerplate ,

Development and build script is working OK ( npm run dev and npm run build ), but the problem happens when I put the build result (in .exe package, not installer) in the file server (windows 2008) over LAN network,

The window was opened but blank white.

I tried different parameters :

  • building in other template (plain js) -> OK
  • packaging it in ASAR -> not OK
  • packaging it with electron-builder -> not OK
  • packaging it with electron-packager -> not OK
  • packaging it with electron-forge -> not OK
  • testing for file size for network latency -> should be not a problem, already tried it with bigger file size and working.

Finally I came up with a hack below but I'd like to know if there's any better solution.

I made it working by packaging it with electron-builder and asar=true option but had to put the whole node_modules directory up in the folder.

node_modules
         |
         ----build
               |
               ----The Program (exe)

I tried the same way with electron-packager but no luck, so I suspect there's a bug or misconfiguration with electron-packager.

I've read also somewhere you have to build a mini express server so it works on file server but I haven't tried it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM