0

I'm developing an app with electron and angular cli 2

The problem is when I install other node packages.

In development mode works fine, but when exporting the final application with electron-packager it tells me that:

A JavaScript error occurred in the main process
    Uncaught Exception:
    Error: Can not find module 'name_package'
    ...
    ...
    ...

Some node packages are:
jsonfile,
async,
electron-json-storage

How can I include all node packages in the final application?

Joshua
  • 5,032
  • 2
  • 29
  • 45

1 Answers1

0

Set the prune option of electron-packager to false like this:

electron-packager . "myApp" --prune=false

When prune is true electron-packager will remove all packages in the devDependencies so setting it to false will probably solve your problem.

Joshua
  • 5,032
  • 2
  • 29
  • 45