-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
install-app-deps: Configuring yargs through package.json is deprecated #3751
Comments
I just discovered them myself. It appears that this pertains to the command line arguments. For instance, what I've been doing in my ...
"scripts": {
"postinstall": "electron-builder install-app-deps",
"start": "electron .",
"build:quick": "electron-builder --dir",
"release:this": "electron-builder",
"release:mac": "electron-builder --mac",
"release:win": "electron-builder --win",
"release:linux": "electron-builder --linux"
}, And So I'm pretty sure these warnings mean: "Please don't use I.e.: Run electron-builder from within a node.js-script. |
https://www.electron.build/api/electron-builder |
@ivancuric It's just weirdly documented. As it says in the API docs: Raw Options refer to the CLI options and there you'll find this: So CLI equals API arguments, i.e. you'd have to pass the command line arguments into the Downside of this is obviously that you'd need several different scripts to pass data to the builder so that it does not always trigger a full chain-rebuild if you just want to drop a testing app into the release directory, so you'd have to do something like this to avoid this: // Some script file, i.e. build.js
const builder = require('electron-builder')
// ... Some logic that builds up the build field, e.g.:
let options = {
"win": {
"target": [
{
"target": "nsis",
"arch": [
"x64",
"ia32"
]
}
]
}
builder.build(options).then((sth) => {
// I have literally no idea what would be passed
// during a successful call, maybe just dump it
// to the console
console.log(sth)
}).catch((e) => {
// Some error handling
console.error(e)
}) |
Ah, thanks! |
Thanks @nathanlesage By the way on successful build it returns paths to all the packages built. |
You're welcome! 🎉 And @mubaidr: classic. |
Working build script: const builder = require('electron-builder')
const Platform = builder.Platform
const config = {
"win": {
"target": [
{
target: ['nsis', 'zip', 'portable'],
"arch": [
"x64",
"ia32"
]
}
]
}
builder
.build({
targets: Platform.WINDOWS.createTarget(),
config,
})
.then(m => {
console.log(m)
})
.catch(e => {
console.error(e)
}) |
This occurs for me even if I'm running |
configure "scripts": { |
Same problem here when I tried to run code containing in my package.json file from the CLI (Terminal) on MacOS Mojave (was working well 3 months ago before my yesterday Electron update).
package.json
When I try to run Thanks to @nathanlesage I finally found the solution. It wasn't really clear for me about where I should put the build.js file et how to execute it (I'm not a Node JS pro). If someone is in my case, here are more detailed steps:
So now, my files looks like below and it works like a charm! package.json (new)
myCustomScript.js "use strict";
const builder = require("electron-builder");
const Platform = builder.Platform;
builder.build({
targets: Platform.MAC.createTarget(),
config: {
"directories": {
"output": "build"
},
"appId": "com.myCompany.myApp",
"productName": "myAppName",
"copyright": "Copyright © 2019 myCompany",
"mac":{
"target":"mas",
"type":"distribution",
"provisioningProfile":"myApp.provisionprofile",
"identity": "MyCompany (idNumber)"
}
}
})
.then(() => {
// handle result
console.log('Build OK!');
})
.catch((error) => {
// handle error
console.log(error);
}) |
How about the |
It seems that the package-json based configuration is deprecated. See electron-userland/electron-builder#3751
…ecated electron-userland#3751 1. remove `yargs` field from `package.json`. 2. upgrade `@types/yargs` for better type definitions. 3. move `parserConfiguration` to the entry point for every "bin".
This warning is from |
…ecated electron-userland#3751 1. remove `yargs` field from `package.json`. 2. upgrade `@types/yargs` for better type definitions. 3. move `parserConfiguration` to the entry point for every "bin". Close electron-userland#3751
Version: 20.39.0
Target: 4.0.8 on platform=win32 arch=x64
I have a few local native modules linked via
file:
inpackage.json
.What are the yargs errors about?
The text was updated successfully, but these errors were encountered: