Skip to content

Cannot find module 'xxxxxx' #4243

@doowb

Description

@doowb

Versions:

  • Electron 0.36.5
  • node 5.1.1
  • OSX 10.9.5 x64

I started off with the example app and was able to open a file and require in a module like jquery inside the renderer process fine.

I want to dynamically create my html files, so I start an express server in the main process and request the files through .loadURL('http://localhost:8080');.

This serves up the file, but then I started getting the Cannot find module 'jquery' error. I tried some of the other suggested and even tried another module from my node_modules but nothing was working.

I was able to use protocol.interceptStringProtocol('file', handler) to proxy file:// requests through to the server and that was working when I ran the project locally by doing electron ..

Once I package up the project and try to run the app, I'm getting the Cannot find module 'jquery' error again. I've verified the node_modules exist in Contents/Resources/app inside the package.

Below is a screen shot of the app devtools open with the error and the globalPaths output. I'm not sure how to debug this or where to look next.

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions