electron / forge

:electron: A complete tool for building and publishing Electron applications
https://electronforge.io
MIT License
6.42k stars 507 forks source link

package.json local paths are not supported #3238

Open mmarczell-graphisoft opened 1 year ago

mmarczell-graphisoft commented 1 year ago

Pre-flight checklist

Electron Forge version

6.1.1

Electron version

v24.3.0

Operating system

macOS 13.3.1

Last known working Electron Forge version

No response

Expected behavior

npx electron-forge make succeeds.

Actual behavior

It outputs an error message saying

An unhandled rejection has occurred inside Forge: Error: ENOENT: no such file or directory, stat '/private/var/folders/4c/w1bj9h4d5_df436ckn8xxmqr0000gq/T/electron-packager/darwin-x64/BIMx-darwin-x64-bvme29/Electron.app/Contents/Resources/app/node_modules/connector'

Steps to reproduce

Have a dependency in package.json specified by a relative path like this: (see npm docs)

"dependencies": {
    "foo": "file:../../foo/foo.node"
}

Run npx electron-forge make.

Additional information

No response

himself65 commented 1 year ago

anyupdate?

1j01 commented 5 months ago

I'm trying to reuse code between web and desktop. This, to me, is Electron's core value proposition. I have created a monorepo setup to facilitate this:

Packaging with a relative path dependency works on Windows, but fails on macOS and Linux.

As of @electron-forge/cli@7.4.0, the error is swallowed, and the CLI exits unceremoniously. In previous versions, the error showed up when the CLI exited. The error can be surfaced on 7.4.0 by using DEBUG=electron-packager.