i want to build this electron app but it gives me an error when i type npm run make the error: It looks like you are missing some dependencies you need to get Electron running. Make sure you have git installed and Node.js version >= 14.17.5 i installed git from https://git-scm.com/download/win but still the same problem this is the package.JSON file:
"name": "OverStat",
"version": "1.0.0",
"main": "main.js",
"devDependencies": {
"#electron-forge/cli": "^6.0.4",
"electron": "^22.0.0",
"electron-reloader": "^1.2.3"
},
"scripts": {
"start": "electron .",
"make": "electron-forge make"
},
"dependencies": {
"electron-builder": "^23.6.0"
}
}
Edit
i restarted VS code and now this is happening
✔ Checking your system
✔ Loading configuration
✖ Resolving make targets
› Could not find any make targets configured for the "win32" platform.
◼ Running package command
◼ Running preMake hook
◼ Making distributables
◼ Running postMake hook
An unhandled rejection has occurred inside Forge:
Error: Could not find any make targets configured for the "win32" platform.
at Task.task (D:\projects\electron learning\node_modules\#electron-forge\core\dist\api\make.js:122:27)
at Task.run (D:\projects\electron learning\node_modules\listr2\dist\index.cjs:978:35)
Edit 2
this is the forge.config.js:
module.exports = {
packagerConfig: {},
rebuildConfig: {},
makers: [
{
name: '#electron-forge/maker-squirrel',
config: {},
},
{
name: '#electron-forge/maker-zip',
platforms: ['darwin'],
},
{
name: '#electron-forge/maker-deb',
config: {},
},
{
name: '#electron-forge/maker-rpm',
config: {},
},
],
};
Update: I've added this in package.json inside the "makers" and it just worked:
"makers": [
{
"name": "#electron-forge/maker-squirrel",
"config": {
"name": "electron_quick_start"
}
},
{
"name": "#electron-forge/maker-zip",
"platforms": [
"darwin"
]
},
{
"name": "#electron-forge/maker-deb",
"config": {}
},
{
"name": "#electron-forge/maker-rpm",
"config": {}
}
]
Related
Asking again 'cause I havent had any luck finding this information. Does anyone know where I can find the documentation or steps to package my Electron app for Windows on a Mac running OS Catalina(10.15)? I've successfully published for DMG and and .zip for Mac OS. Using electron-forge currently.
I read the Electron documentation to use wine or mono and I installed both, but I'm not sure what to do after that. I tried running the electron-packager after installing both but it still ignores the squirrel-maker for Windows. Tried running electron-make and publish, all ignore the squirrel-maker.
I got an error once that I needed to use 'electron-compile' but when I installed it and tried using it, it kept throwing an error on my source code when it would come across a dot operator for arrays or objects? Ex:
let object = {Name:"Something"}
let object2 = {Age:20}
let newObject = {
...object,
...object2
}
Would throw an error when trying to use the 'electron-compile' framework.
Really trying to avoid flipping back and forth between Windows and Mac on my mac and having to install electron on both platforms.
package.json file:
"name": "MyApp",
"productName": "My Fantastic App",
"version": "1.1.4",
"description": "The worlds most boring app.",
"main": "src/index.js",
"scripts": {
"start": "electron-forge start",
"package": "electron-forge package",
"make": "electron-forge make",
"publish": "electron-forge publish",
"lint": "echo \"No linting configured\"",
"dist": "build",
"build": "electron-builder build --dir"
},
"keywords": [],
"author": "sychordCoder",
"license": "MIT",
"config": {
"forge": "./custom-not.js"
},
"dependencies": {
"dotenv": "^9.0.2",
"electron-dl": "^3.2.1",
"electron-is-dev": "^2.0.0",
"electron-log": "^4.3.5",
"electron-squirrel-startup": "^1.0.0",
"electron-updater": "^4.3.9",
"firebase": "^8.6.2",
"jquery": "^3.6.0",
"pug": "^3.0.2"
},
"devDependencies": {
"#electron-forge/cli": "^6.0.0-beta.54",
"#electron-forge/maker-deb": "^6.0.0-beta.54",
"#electron-forge/maker-dmg": "^6.0.0-beta.54",
"#electron-forge/maker-rpm": "^6.0.0-beta.54",
"#electron-forge/maker-squirrel": "^6.0.0-beta.54",
"#electron-forge/maker-zip": "^6.0.0-beta.54",
"#electron-forge/publisher-github": "^6.0.0-beta.54",
"electron": "^12.0.0",
"uglify-js": "^3.13.7"
}
}
This is my config js file:
module.exports = {
packagerConfig: {
name: 'MyApp',
executableName: 'MyApp',
asar: true,
icon: 'src/images/icon128#2x',
ignore: ["file1source.js","file2source.js"],
appBundleId: 'MyAppId',
osxSign: {
identity: 'Developer ID Application: John Smith(90210)',
hardenedRuntime: true,
'gatekeeper-assess': false,
entitlements: 'static/entitlements.plist',
'entitlements-inherit': 'static/entitlements.plist',
'signature-flags': 'library'
},
osxNotarize: {
appleId: process.env.APPLE_ID,
appleIdPassword: process.env.APPLE_PASSWORD
}
},
makers: [
{
name: '#electron-forge/maker-squirrel',
platforms: [
"win32"
],
config: {
name: 'MyApp',
description: 'The worlds most boring app.',
version: '1.1.4'
}
},
{
name: '#electron-forge/maker-zip',
platforms: [
'darwin'
]
},
{
name: '#electron-forge/maker-deb',
config: {}
},
{
name: '#electron-forge/maker-rpm',
config: {}
},
{
name: '#electron-forge/maker-dmg',
config: {
overwrite:true,
icon: 'src/images/icon128#2x.icns'
}
}
],
publishers: [
{
name: '#electron-forge/publisher-github',
config: {
repository: {
owner: 'githubOwner',
name: 'gitHubReleases'
},
prerelease: false,
releaseType: "release",
authToken: process.env.GH_TOKEN
}
}
]
}
Any help is greatly appreciated.
Thank you,
you should open the wine terminal to run command of build electron.
Hi I have an Electron app that's running Puppeteer (To be specific it is puppeteer-cluster). I want to be able to package this app into a .exe that I can distribute with.
One requirement though is that I have to be able to pack it with --asar.
Here's some stuff I tried but failed:
I tried setting the executable path :
let ChromiumPath = path.join(__dirname, "..", "..", "..",".local-chromium", "win64-809590", "chrome-win","chrome.exe");
const cluster = await Cluster.launch({
puppeteer,
concurrency: Cluster.CONCURRENCY_BROWSER,
maxConcurrency: arg.length,
timeout: 340000,
puppeteerOptions: {
args: browserArgs,
headless: false,
ignoreHTTPSErrors: true,
executablePath : ChromiumPath
},
perBrowserOptions: perBrowserOptions,
});
I tried specifying the unpack directory in package.json
"config": {
"forge": {
"packagerConfig": {
"asar": {
"unpack": "**/node_modules/puppeteer/.local-chromium/**/*"
}
}.....
Here's how i package my app:
electron-packager . --asar
And if needed, here's my package.json:
{
"name": "testBrowsers",
"productName": "testBrowsers",
"version": "1.0.0",
"description": "IDk",
"main": "src/index.js",
"scripts": {
"start": "electron-forge start",
"package": "electron-packager ./ testBrowsers --platform=win32 --arch=x64 --icon=./tool.ico --out=./dist --electron-version=10.1.4 --overwrite",
"make": "electron-forge make",
"publish": "electron-forge publish",
"lint": "echo \"No linting configured\""
},
"keywords": [],
"author": "Otter",
"license": "MIT",
"config": {
"forge": {
"packagerConfig": {
"asar": {
"unpack": "**/node_modules/puppeteer/.local-chromium/**/*"
}
},
"makers": [
{
"name": "#electron-forge/maker-squirrel",
"config": {
"name": "testBrowsers"
}
},
{
"name": "#electron-forge/maker-zip",
"platforms": [
"darwin"
]
},
{
"name": "#electron-forge/maker-deb",
"config": {}
},
{
"name": "#electron-forge/maker-rpm",
"config": {}
}
]
}
},
"dependencies": {
"electron-squirrel-startup": "^1.0.0",
"proxy-chain": "^0.4.5",
"puppeteer": "^5.4.1",
"puppeteer-cluster": "^0.22.0",
"puppeteer-extra": "^3.1.15",
"puppeteer-extra-plugin-stealth": "^2.6.5",
"puppeteer-page-proxy": "^1.2.8",
"taskkill": "^3.1.0"
},
"devDependencies": {
"#electron-forge/cli": "^6.0.0-beta.54",
"#electron-forge/maker-deb": "^6.0.0-beta.54",
"#electron-forge/maker-rpm": "^6.0.0-beta.54",
"#electron-forge/maker-squirrel": "^6.0.0-beta.54",
"#electron-forge/maker-zip": "^6.0.0-beta.54",
"electron": "10.1.4"
}
}
Thanks I really hope someone can help me out with this issue! :)
You will probably need to package chromium separately from your application. At least that's what you would do when trying to package a node application using something like pkg.
You can load chromium in puppeteer from a custom install path when launching a browser instance. So in code you will need to specify that path and make sure that your packaged app has the ability to read that path.
Your distribution file (probably an archive) will then have the chromium build that puppeteer needs separate from the actual app exe
have a look at a similar discussion here
https://github.com/vercel/pkg/issues/204
I have a dot net core console app that I want to run as a webjob in Azure. When it tries to execute I see in the logs
Error: assembly specified in the dependencies manifest was not found -- package: 'Microsoft.DotNet.InternalAbstractions', version: '1.0.0', path: 'lib/netstandard1.3/Microsoft.DotNet.InternalAbstractions.dll'
My project.json looks like this
{
"buildOptions": {
"emitEntryPoint": true,
"copyToOutput": [ "appsettings.json", "run.cmd" ]
},
"dependencies": {
"Helga.Core": "1.0.0-*",
"Helga.UpdateParkings": "1.0.0-*",
"Microsoft.Extensions.Configuration": "1.0.0",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0",
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.1"
}
},
"frameworks": {
"netcoreapp1.0": {
"imports": "dnxcore50"
}
},
"publishOptions": {
"include": [
"appsettings.json",
"run.cmd"
]
},
"version": "1.0.0-*"
}
but in project.lock.json I see
"Microsoft.DotNet.InternalAbstractions/1.0.0": {
"type": "package",
"dependencies": {
"System.AppContext": "4.1.0",
"System.Collections": "4.0.11",
"System.IO": "4.1.0",
"System.IO.FileSystem": "4.0.1",
"System.Reflection.TypeExtensions": "4.1.0",
"System.Runtime.Extensions": "4.1.0",
"System.Runtime.InteropServices": "4.1.0",
"System.Runtime.InteropServices.RuntimeInformation": "4.0.0"
},
"compile": {
"lib/netstandard1.3/Microsoft.DotNet.InternalAbstractions.dll": {}
},
"runtime": {
"lib/netstandard1.3/Microsoft.DotNet.InternalAbstractions.dll": {}
}
},
Please advice.
I had made the deployment by zipping up the bin/debug folder and apparently the build references assemblies in installed sdk's etc.
When I did a Publish of the project to the filesystem and zipped up the PublishOutput folder instead everything started working because all dependant assemblies were copied to that folder.
I'm creating a module that I want to be installed globally, package.json
{
"name": "my-module",
"description": "My module",
"version": "0.1.0",
"repository": {
"type": "git",
"url": "..."
},
"bugs": {
"url": "..."
},
"files": [
"lib",
"public",
"README.md",
"index.js",
"my-module.js",
"package.json",
"tests"
],
"engines": [
"node >= 0.10.0"
],
"license": "MIT",
"dependencies": {
....
},
"scripts": {},
"devDependencies": {},
"bin": {
"module": "./module.js"
}
}
So I published it to npm registry, after installation (on Windows):
I have incorrect files in global npm modules:
my-module:
"$basedir/node_modules/my-module/my-module.js" "$#"
exit $?
my-module cmd:
"%~dp0\node_modules\my-module\my-module.js" %*
While other installed global packages have more code in their cmd files.
Maybe something wrong with my package json? But I've looked at other module's package.json files and cannot get what is wrong.
I found it, bin module (my-module.js) should contain comment in first line:
#!/usr/bin/env node
I'm new to NodeJS and Grunt and I'm struggling to make this work.
Here's what I get :
$> grunt
Loading "Gruntfile.js" tasks...ERROR
>> ReferenceError: grunt is not defined
Warning: Task "default" not found. Use --force to continue.
Aborted due to warnings.
Here's my Gruntfile :
module.exports = function(grunt) {
grunt.initConfig({
compass: {
dist: {
options: {
config: 'config/config.rb'
}
}
}
});
};
grunt.loadNpmTasks('grunt-contrib-compass');
grunt.registerTask('default', 'compass');
And here's my package.json :
{
"name": "tests",
"version": "0.0.0",
"description": "Grunt Tests",
"main": "index.js",
"devDependencies": {
"grunt": "~0.4.2",
"grunt-contrib-compass": "~0.6.0",
"grunt-contrib-watch": "~0.5.3",
"grunt-cli": "~0.1.11"
},
"scripts": {
"test": "grunt compass"
},
"repository": {
"type": "git",
"url": "https://github.com/Bertrand31/grunttests.git"
},
"keywords": [
"Grunt",
"NodeJS",
"NPM",
"SASS",
"Compass"
],
"author": "Bertrand Junqua",
"license": "GPL",
"bugs": {
"url": "https://github.com/Bertrand31/grunttests/issues"
},
"homepage": "https://github.com/Bertrand31/grunttests"
}
Oh and I'm running this on a Debian Wheezy.
If you have any idea, let me know.
Thanks a lot guys !
You're calling grunt.loadNpmTasks and grunt.registerTask from a scope where grunt is not defined. You'll need to call them within the module.exports function:
module.exports = function(grunt) {
grunt.initConfig({
compass: {
dist: {
options: {
config: 'config/config.rb'
}
}
}
});
// Call these here instead, where the variable grunt is defined.
grunt.loadNpmTasks('grunt-contrib-compass');
grunt.registerTask('default', 'compass');
};