question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot find module 'dmg-license'

See original GitHub issue
  • Version: 22.11.3
  • Electron Version: 12.0.5
  • Target: windows, macos, linux
 ⨯ Cannot find module 'dmg-license'
Require stack:
- /home/justin/Projects/xplorer/node_modules/dmg-builder/out/dmgLicense.js
- /home/justin/Projects/xplorer/node_modules/dmg-builder/out/dmg.js
- /home/justin/Projects/xplorer/node_modules/dmg-builder/out/dmgUtil.js
- /home/justin/Projects/xplorer/node_modules/app-builder-lib/out/macPackager.js
- /home/justin/Projects/xplorer/node_modules/app-builder-lib/out/packager.js
- /home/justin/Projects/xplorer/node_modules/app-builder-lib/out/index.js
- /home/justin/Projects/xplorer/node_modules/electron-builder/out/builder.js
- /home/justin/Projects/xplorer/node_modules/electron-builder/out/cli/cli.js
- /home/justin/Projects/xplorer/node_modules/electron-builder/cli.js  failedTask=build stackTrace=Error: Cannot find module 'dmg-license'
Require stack:
- /home/justin/Projects/xplorer/node_modules/dmg-builder/out/dmgLicense.js
- /home/justin/Projects/xplorer/node_modules/dmg-builder/out/dmg.js
- /home/justin/Projects/xplorer/node_modules/dmg-builder/out/dmgUtil.js
- /home/justin/Projects/xplorer/node_modules/app-builder-lib/out/macPackager.js
- /home/justin/Projects/xplorer/node_modules/app-builder-lib/out/packager.js
- /home/justin/Projects/xplorer/node_modules/app-builder-lib/out/index.js
- /home/justin/Projects/xplorer/node_modules/electron-builder/out/builder.js
- /home/justin/Projects/xplorer/node_modules/electron-builder/out/cli/cli.js
- /home/justin/Projects/xplorer/node_modules/electron-builder/cli.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:815:15)
    at Function.Module._load (internal/modules/cjs/loader.js:667:27)
    at Module.require (internal/modules/cjs/loader.js:887:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (/home/justin/Projects/xplorer/node_modules/dmg-builder/src/dmgLicense.ts:7:1)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)
    at Module.require (internal/modules/cjs/loader.js:887:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (/home/justin/Projects/xplorer/node_modules/dmg-builder/src/dmg.ts:13:1)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)

The version works were v20.31.2.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:3
  • Comments:10

github_iconTop GitHub Comments

1reaction
mmaiettacommented, May 16, 2021

Oomph, you’re compiling on an M1? Can you double check that dmg-license is present in your node_modules? The module should be found, it’s listed in electron-builder’s dependencies as well https://github.com/electron-userland/electron-builder/blob/c623279a31d3d203ad1f150d83905a7e1f58a731/package.json#L39-L41 https://github.com/electron-userland/electron-builder/blob/c623279a31d3d203ad1f150d83905a7e1f58a731/packages/dmg-builder/package.json#L23-L25 IIRC it’s marked optional in the dmg-builder package.json because it only works on mac

0reactions
airtonixcommented, Aug 21, 2021
x pnpm i || echo "💥 PNPM_INSTALL_UTTERLY_FAILED"
Scope: all 329 workspace projects
...

 ERROR  Unsupported platform for registry.npmjs.org/iconv-corefoundation/1.1.6: wanted {"cpu":["any"],"os":["darwin"]} (current: {"os":"linux","cpu":"x64"})
Progress: resolved 1145, reused 1142, downloaded 1, added 0
Downloading registry.npmjs.org/app-builder-bin/3.5.12: 14.9 MB/41.8 MB
💥 PNPM_INSTALL_UTTERLY_FAILED
Read more comments on GitHub >

github_iconTop Results From Across the Web

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...
Read more >
dmg-license is an optional dependency, so building fails ...
Cannot find module 'dmg-license'. After inspecting the package.json of electron-builder/packages/dmg-builder I found dmg-license to be ...
Read more >
dmg-license - npm
Generate license agreements for macOS .dmg files. ... Start using dmg-license in your project by running `npm i dmg-license`.
Read more >
electron-builder failing in macOS : r/electronjs - Reddit
Hello, I am having trouble building a production build for my electron app using electron-builder in macOS with a dmg target.
Read more >
DMG - electron-builder
To add license to DMG, create file license_LANG_CODE.txt in the build resources. Multiple license files in different languages are supported — use lang...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found