Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dmg-license is an optional dependency, so building fails caused by 'npm ci --no-audit --no-optional' #6489

Open
ThomasHalwax opened this issue Dec 10, 2021 · 4 comments

Comments

@ThomasHalwax
Copy link

  • Electron-Builder Version: 22.14.5
  • Node Version: 16.13.1
  • Electron Version: 16.0.4
  • Electron Type (current, beta, nightly): current
  • Target: OS-X

We are building our application by making use of Github Actions. The steps are:

npm ci --no-audit --no-optional // <<-- no-optional skips dmg-license
npm run webpack:production
electron-builder --mac

The last command fails with

⨯ Cannot find module 'dmg-license'

After inspecting the package.json of electron-builder/packages/dmg-builder I found dmg-license to be declared optional.

"optionalDependencies": {
  "dmg-license": "^1.0.9"
}

If electron-builder depends on dmg-license can you please move it to the dependencies section?

Thanks!

@mmaietta
Copy link
Collaborator

It's not possible to move it to dependencies option because dmg-license can't be installed on windows/linux build systems IIRC. Due to the configuration of the monorepo with dmg-builder, dmg-license must remain in the optionalDependencies section.
An alternative idea is for you to have dmg-license directly added as a devDependency to your project?

@source-xm
Copy link

I have also encountered this problem. The dependency of dmg-license seems to be added after electron-buider@20.39.0. The dmg-license is not used in version 20.39.0, which can avoid this problem. For normal applications, it should be Doesn't need a license

@CPSO
Copy link

CPSO commented Mar 28, 2022

For anyone coming across this, i solved my problem with selecting macos 10.15 macos-10.15 and by adding a extra step in the build process.

name: install dmg-license 
run: npm i dmg-license

My build.yml for mac looks like this

 build_on_mac:
    runs-on: macos-10.15
    steps:
    - uses: actions/checkout@v1
    - uses: actions/setup-node@master
      with:
        node-version: 16.14.2
    - name: install dependencies
      run: npm install
    - name: install dmg-license
      run: npm i dmg-license
    - name: build
      env:
        GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      run: npm run electron:build --macos

@undergroundwires
Copy link

I had the same issue with 24.6.4, I tried different solutions and the cleanest solution I found which works cross operating systems consistently and represents the intention explicitly in code was:

npm install "dmg-license" --save-optional

This adds following lines to package.json:

  "optionalDependencies": {
    "dmg-license": "^1.0.11"
  },

undergroundwires added a commit to undergroundwires/privacy.sexy that referenced this issue Nov 1, 2023
- Migrate from "Vue 2.X" to "Vue 3.X"
- Migrate from "Vue Test Utils v1" to "Vue Test Utils v2"

Changes in detail:

- Change `inserted` to `mounted`.
- Change `::v-deep` to `:deep`.
- Change to Vue 3.0 `v-modal` syntax.
- Remove old Vue 2.0 transition name, keep the ones for Vue 3.0.
- Use new global mounting API `createApp`.
- Change `destroy` to `unmount`.
- Bootstrapping:
  - Move `provide`s for global dependencies to a bootsrapper from
    `App.vue`.
  - Remove `productionTip` setting (not in Vue 3).
  - Change `IVueBootstrapper` for simplicity and Vue 3 compatible API.
  - Add missing tests.
- Remove `.text` access on `VNode` as it's now internal API of Vue.
- Import `CSSProperties` from `vue` instead of `jsx` package.
- Shims:
  - Remove unused `shims-tsx.d.ts`.
  - Remove `shims-vue.d.ts` that's missing in quickstart template.
- Unit tests:
  - Remove old typing workaround for mounting components.
  - Rename `propsData` to `props`.
  - Remove unneeded `any` cast workarounds.
  - Move stubs and `provide`s under `global` object.

Other changes:

- Add `dmg-license` dependency explicitly due to failing electron builds
  on macOS (electron-userland/electron-builder#6520,
  electron-userland/electron-builder#6489). This was a side-effect of
  updating dependencies for this commit.
LarrMarburger added a commit to LarrMarburger/privacy.sexy that referenced this issue Nov 16, 2023
- Migrate from "Vue 2.X" to "Vue 3.X"
- Migrate from "Vue Test Utils v1" to "Vue Test Utils v2"

Changes in detail:

- Change `inserted` to `mounted`.
- Change `::v-deep` to `:deep`.
- Change to Vue 3.0 `v-modal` syntax.
- Remove old Vue 2.0 transition name, keep the ones for Vue 3.0.
- Use new global mounting API `createApp`.
- Change `destroy` to `unmount`.
- Bootstrapping:
  - Move `provide`s for global dependencies to a bootsrapper from
    `App.vue`.
  - Remove `productionTip` setting (not in Vue 3).
  - Change `IVueBootstrapper` for simplicity and Vue 3 compatible API.
  - Add missing tests.
- Remove `.text` access on `VNode` as it's now internal API of Vue.
- Import `CSSProperties` from `vue` instead of `jsx` package.
- Shims:
  - Remove unused `shims-tsx.d.ts`.
  - Remove `shims-vue.d.ts` that's missing in quickstart template.
- Unit tests:
  - Remove old typing workaround for mounting components.
  - Rename `propsData` to `props`.
  - Remove unneeded `any` cast workarounds.
  - Move stubs and `provide`s under `global` object.

Other changes:

- Add `dmg-license` dependency explicitly due to failing electron builds
  on macOS (electron-userland/electron-builder#6520,
  electron-userland/electron-builder#6489). This was a side-effect of
  updating dependencies for this commit.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants