saltyshiomix / nextron

⚡ Next.js + Electron ⚡
https://npm.im/nextron
MIT License
3.95k stars 227 forks source link

Electron Forge Compatibility #317

Open L-U-C-K-Y opened 1 year ago

L-U-C-K-Y commented 1 year ago

Thank for creating this package!

Is it compatible with electron forge?

I am trying to add it in the following way:

npx create-nextron-app my-app --example with-material-ui

yarn add --dev @electron-forge/cli

yarn electron-forge import
# Here I get an error

Error:

❯ yarn electron-forge import
yarn run v1.22.19
warning ../../../package.json: No license field
$ /Users/user/my-app/node_modules/.bin/electron-forge import
✔ Checking your system
✔ Locating importable project
❯ Processing configuration and dependencies
  ✖ Installing dependencies
    › Failed to install modules: ["electron-squirrel-startup"]
      With output: Command failed with a non-zero return code (127):
      yarn add electron-squirrel-startup
      [1/4] Resolving packages...
      [2/4] Fetching packages...
      [3/4] Linking dependencies...
      [4/4] Building fresh packages...
      success Saved lockfile.
      success Saved 1 new dependency.
      info Direct dependencies
      └─ electron-squirrel-startup@1.0.0
      info All dependencies
      └─ electron-squirrel-startup@1.0.0
      $ electron-builder install-app-deps
      info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
      warning ../../../package.json: No license field
      warning "@emotion/react > @emotion/babel-plugin@11.10.5" has unmet peer dependency "@babel/core@^7.0.0".
      warning "@emotion/react > @emotion/babel-plugin > @babel/plugin-syntax-jsx@7.18.6" has unmet peer dependency "@babel/core@^7.0.0-0".
      /bin/sh: electron-builder: command not found
      error Command failed with exit code 127.
      warning ../../../package.json: No license field
      warning "@emotion/react > @emotion/babel-plugin@11.10.5" has unmet peer dependency "@babel/core@^7.0.0".
      warning "@emotion/react > @emotion/babel-plugin > @babel/plugin-syntax-jsx@7.18.6" has unmet peer dependency "@babel/core@^7.0.0-0".
      /bin/sh: electron-builder: command not found
      error Command failed with exit code 127.
  ◼ Copying base template Forge configuration
  ◼ Fixing .gitignore
◼ Finalizing import

An unhandled rejection has occurred inside Forge:
Error: Failed to install modules: ["electron-squirrel-startup"]

With output: Command failed with a non-zero return code (127):
yarn add electron-squirrel-startup
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
success Saved 1 new dependency.
info Direct dependencies
└─ electron-squirrel-startup@1.0.0
info All dependencies
└─ electron-squirrel-startup@1.0.0
$ electron-builder install-app-deps
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

warning ../../../package.json: No license field
warning "@emotion/react > @emotion/babel-plugin@11.10.5" has unmet peer dependency "@babel/core@^7.0.0".
warning "@emotion/react > @emotion/babel-plugin > @babel/plugin-syntax-jsx@7.18.6" has unmet peer dependency "@babel/core@^7.0.0-0".
/bin/sh: electron-builder: command not found
error Command failed with exit code 127.
warning ../../../package.json: No license field
warning "@emotion/react > @emotion/babel-plugin@11.10.5" has unmet peer dependency "@babel/core@^7.0.0".
warning "@emotion/react > @emotion/babel-plugin > @babel/plugin-syntax-jsx@7.18.6" has unmet peer dependency "@babel/core@^7.0.0-0".
/bin/sh: electron-builder: command not found
error Command failed with exit code 127.
at exports.default (/Users/user/my-app/node_modules/@electron-forge/core/dist/util/install-dependencies.js:52:19)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async Task.task (/Users/user/my-app/node_modules/@electron-forge/core/dist/api/import.js:168:29)
    at async Task.run (/Users/user/my-app/node_modules/listr2/dist/index.cjs:978:11)
    at async /Users/user/my-app/node_modules/p-map/index.js:57:22
alexis-piquet commented 1 year ago

Hey @L-U-C-K-Y. Electron-Forge is for signed applications and as I can see you have not defined the Licence field in you package.json. Could it be related? Maybe.