jolteon icon indicating copy to clipboard operation
jolteon copied to clipboard

`Cannot find module` when run as packaged osx app

Open nicnocquee opened this issue 8 years ago • 0 comments

Hey,

I'm trying to use some module like nodegit or fs-extra in the client process, so I installed them npm install --save <module> and use them like so const something = require('modulename').

If I run the app via gulp serve everything works fine. But when I package it via gulp package-osx and double click the app, it always fails with Cannot find module <module_name> error. However, if I go inside the packaged app to appname.app/Contents/Resources/app directory, and run electron . from command line, everything works fine.

Any idea? Sample app here

Versions: Node 5.1.1, Electron 0.36.12. I tried Node 6 and Electron 1, but also failed.

nicnocquee avatar May 31 '16 09:05 nicnocquee