Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

714
Views
electron-builder error: Cannot find module 'dmg-license'

I am looking for a simple way to build an electron app for macOS, from a linux machine.

Unfortunately, the electron-builder -m command doesn't work, here is the full output of the command:

electron-builder -m              
  • electron-builder  version=22.14.13 os=5.11.0-49-generic
  • loaded configuration  file=package.json ("build" field)
  • writing effective config  file=dist/builder-effective-config.yaml
⨯ Cannot find module 'dmg-license'
Require stack:
- /home/myUser/.nvm/versions/node/v16.13.0/lib/node_modules/electron-builder/node_modules/dmg-builder/out/dmgLicense.js
- /home/myUser/.nvm/versions/node/v16.13.0/lib/node_modules/electron-builder/node_modules/dmg-builder/out/dmg.js
- /home/myUser/.nvm/versions/node/v16.13.0/lib/node_modules/electron-builder/node_modules/dmg-builder/out/dmgUtil.js
- /home/myUser/.nvm/versions/node/v16.13.0/lib/node_modules/electron-builder/node_modules/app-builder-lib/out/macPackager.js
- /home/myUser/.nvm/versions/node/v16.13.0/lib/node_modules/electron-builder/node_modules/app-builder-lib/out/packager.js
- /home/myUser/.nvm/versions/node/v16.13.0/lib/node_modules/electron-builder/node_modules/app-builder-lib/out/index.js
- /home/myUser/.nvm/versions/node/v16.13.0/lib/node_modules/electron-builder/out/builder.js
- /home/myUser/.nvm/versions/node/v16.13.0/lib/node_modules/electron-builder/out/cli/cli.js
- /home/myUser/.nvm/versions/node/v16.13.0/lib/node_modules/electron-builder/cli.js  failedTask=build stackTrace=Error: Cannot find module 'dmg-license'

I have tried to install the dependency but it can be installed only on macOS...

I have also tried to install different versions, including 20.37.*,22.11.7, @latest (22.14.13) and @next

Is there any alternative way to build an app for macOS (the program I am using is for private purpose, so it's ok if it takes extra user steps to install) ?

Or any way to fix this dependency issue ?

about 4 years ago · Santiago Gelvez
1 answers
Answer question

0

Try:

npm i dmg-license

Perhaps this would be an alternative way to build. https://www.electronforge.io/

EDIT:

I had a similar error but my issue was I created subdirectories and the default package.json only included the top level directory in the build. The solution was to change in my electron package.json

  "build": {
    "appId": "com.example.capacitor-app",
    "productName": "Capacitor App",
    "files": [
      "assets/*",
      "build/*",
      "preloader.js",
      "plugins/*",
      "capacitor.config.json",
      "app/**"
    ],

To

  "build": {
    "appId": "com.example.capacitor-app",
    "productName": "Capacitor App",
    "files": [
      "assets/**",
      "build/**",
      "preloader.js",
      "plugins/**",
      "capacitor.config.json",
      "app/**"
    ],

Note another person had a cannot find module error because he was using www instead of app for the angular code directory: https://github.com/electron-userland/electron-builder/issues/303

about 4 years ago · Santiago Gelvez Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!