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.

Passing dir option to builder.build() throws "Unknown option" error

See original GitHub issue
  • Version: 22.8.0
  • Electron Version: 9.1.2
  • Electron Type (current, beta, nightly): current
  • Target: Windows

Passing the dir option to builder.build():

const builder = require('electron-builder')
const Platform = builder.Platform

builder.build({
  targets: Platform.WINDOWS.createTarget(),
  dir: true,
})

throws an error:

  • electron-builder  version=22.8.0 os=10.0.18362
(node:13872) UnhandledPromiseRejectionWarning: Error: Unknown option "dir"
    at checkBuildRequestOptions (C:\dev\carlo\pbi-tips\business-ops\node_modules\app-builder-lib\src\index.ts:44:13)
    at build (C:\dev\carlo\pbi-tips\business-ops\node_modules\app-builder-lib\src\index.ts:50:3)
    at Object.build (C:\dev\carlo\pbi-tips\business-ops\node_modules\electron-builder\src\builder.ts:218:10)
    at createExe (C:\dev\carlo\pbi-tips\business-ops\bld\build-exe.js:12:31)

even though according to the typescript types this should be valid:

export interface CliOptions extends PackagerOptions, PublishOptions {
    x64?: boolean;
    ia32?: boolean;
    armv7l?: boolean;
    arm64?: boolean;
    dir?: boolean;
}

export declare function build(rawOptions?: CliOptions): Promise<Array<string>>;

I couldn’t find documentation around thedir flag on JavaScript API (although it is present in the CLI documentation).

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:10 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
zpostencommented, Aug 7, 2020

As a workaround, this seems to work:

builder.build({
  targets: Platform.WINDOWS.createTarget(builder.DIR_TARGET),
})
0reactions
stale[bot]commented, Aug 28, 2021

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

mkdir throws 'unknown option' error - bash - Stack Overflow
The mkdir command tries to interpret "-AFolder/" as an option as it begins with a - . Use the -- dummy argument to...
Read more >
Error Codes | Yarn - Package Manager
When passing the --immutable option to yarn install , Yarn will ensure that the lockfile isn't modified in the process and will instead...
Read more >
Exploring Joshua Bloch's Builder design pattern in Java
Bloch's Builder pattern can be thought of as a workaround for a missing language feature.
Read more >
Protocol Buffer Basics: Java - Google Developers
This tutorial provides a basic Java programmer's introduction to working with protocol buffers. By walking through creating a simple example application, ...
Read more >
Static files in ASP.NET Core | Microsoft Learn
AddAuthorization(options => { options.FallbackPolicy = new AuthorizationPolicyBuilder() .RequireAuthenticatedUser() .Build(); }); var app ...
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