When I use electron-builder to package an NSIS program, I get: Fatal error: Unable to parse version string for FileVersion - node.js

Electron-Builder Version: 22.14.5
Node Version: v16.13.1
Electron Version: 16.0.6
Electron Type (current, beta, nightly): current
Not using electron-updater
Target: nsis
Here is the console log.
Compilation succeeded.
• electron-builder version=22.14.5 os=5.10.89-1-MANJARO
• loaded configuration file=/home/aszswaz/document/notebook/code-example/webpack-electron-vue/config/electron-builder-win.js
• Specified application directory equals to project dir — superfluous or wrong configuration appDirectory=./
• writing effective config file=dist/electron-builder/builder-effective-config.yaml
• skipped dependencies rebuild reason=npmRebuild is set to false
• packaging platform=win32 arch=x64 electron=v16.0.6 appOutDir=dist/electron-builder/win-unpacked
• asar usage is disabled — this is strongly not recommended solution=enable asar and use asarUnpack to unpack files that must be externally available
• asar usage is disabled — this is strongly not recommended solution=enable asar and use asarUnpack to unpack files that must be externally available
⨯ cannot execute cause=exit status 1
errorOut=Fatal error: Unable to parse version string for FileVersion
0024:fixme:ver:GetCurrentPackageId (0032FE94 00000000): stub
command=wine /home/aszswaz/.cache/electron-builder/winCodeSign/winCodeSign-2.6.0/rcedit-ia32.exe /home/aszswaz/document/notebook/code-example/webpack-electron-vue/dist/electron-builder/win-unpacked/hanna.exe --set-version-string FileDescription hanna --set-version-string ProductName hanna --set-version-string LegalCopyright aszswaz --set-file-version v1.0.0 --set-product-version 1.0.0.0 --set-version-string InternalName hanna --set-version-string OriginalFilename '' --set-version-string CompanyName aszswaz --set-icon /home/aszswaz/document/notebook/code-example/webpack-electron-vue/public/icon.ico
workingDir=
This is the config file used.
module.exports = {
appId: "cn.aszswaz.demo.webpack-electron-vue",
productName: "hanna",
copyright: "aszswaz",
asar: false,
files: [
"dist/app/*",
"!**/node_modules/vue/*",
"!**/node_modules/vue-router/*"
],
artifactName: "${productName}-${arch}-${version}.${ext}",
directories: {
app: "./",
output: "./dist/electron-builder"
},
win: {
target: "nsis",
icon: "public/icon.ico"
},
nsis: {
oneClick: false,
perMachine: true,
allowToChangeInstallationDirectory: true
},
npmRebuild: false,
buildVersion: "v1.0.0",
electronCompile: false,
electronDownload: {
version: "16.0.6",
platform: "win32",
arch: "x64",
cache: process.cwd() + "/cache"
},
electronVersion: "v16.0.6"
}
What is the reason for this error? How can I fix this error?

Related

Validation Error in running Hyperledger Caliper V0.4.2 with Fabric 2.1

When I have been running the Caliper V0.4.2 for measuring the benchmarks of Fabric 2.1.0 1.4.7, I got the below error
ValidationError: child "version" fails because ["version" must be one of [1.0]]. child "clients" fails because ["clients" is required]. child "channels" fails because ["channels" must be an object]. child "organizations" fails because ["organizations" must be an object]. child "orderers" fails because ["orderers" is required]. child "peers" fails because ["peers" is required]
at Object.exports.process (/home/gow/fabric-benchmarks/caliper-benchmarks/node_modules/#hapi/joi/lib/errors.js:202:19)
at internals.Object._validateWithOptions (/home/gow/fabric-benchmarks/caliper-benchmarks/node_modules/#hapi/joi/lib/types/any/index.js:763:31)
at module.exports.internals.Any.root.validate (/home/gow/fabric-benchmarks/caliper-benchmarks/node_modules/#hapi/joi/lib/index.js:145:23)
at Function._validateTopLevel (/home/gow/fabric-benchmarks/caliper-benchmarks/node_modules/#hyperledger/caliper-fabric/lib/configValidator.js:208:26)
at Function.validateNetwork (/home/gow/fabric-benchmarks/caliper-benchmarks/node_modules/#hyperledger/caliper-fabric/lib/configValidator.js:58:25)
at new FabricConnector (/home/gow/fabric-benchmarks/caliper-benchmarks/node_modules/#hyperledger/caliper-fabric/lib/fabric-connector.js:107:25)
at CaliperEngine.connectorFactory [as adapterFactory] (/home/gow/fabric-benchmarks/caliper-benchmarks/node_modules/#hyperledger/caliper-fabric/lib/connectorFactory.js:26:23)
at CaliperEngine.run (/home/gow/fabric-benchmarks/caliper-benchmarks/node_modules/#hyperledger/caliper-core/lib/manager/caliper-engine.js:93:36)
at Function.handler (/home/gow/fabric-benchmarks/caliper-benchmarks/node_modules/#hyperledger/caliper-cli/lib/launch/lib/launchManager.js:62:43)
at Object.module.exports.handler (/home/gow/fabric-benchmarks/caliper-benchmarks/node_modules/#hyperledger/caliper-cli/lib/launch/launchManagerCommand.js:46:44)
isJoi: true,
name: 'ValidationError',
details:
[ { message: '"version" must be one of [1.0]',
path: [Array],
type: 'any.allowOnly',
context: [Object] },
{ message: '"clients" is required',
path: [Array],
type: 'any.required',
context: [Object] },
{ message: '"channels" must be an object',
path: [Array],
type: 'object.base',
context: [Object] },
{ message: '"organizations" must be an object',
path: [Array],
type: 'object.base',
context: [Object] },
{ message: '"orderers" is required',
path: [Array],
type: 'any.required',
context: [Object] },
{ message: '"peers" is required',
path: [Array],
type: 'any.required',
context: [Object] } ],
_object:
{ name: 'Caliper Benchmarks',
version: '2.1.0',
caliper: { blockchain: 'fabric' },
channels: [ [Object] ],
organizations: [ [Object] ] },
annotate: [Function] }
Command that I run are,
npm init -y
npm install --only=prod #hyperledger/caliper-cli#0.4.0
npx caliper bind --caliper-bind-sut fabric:2.1
./network.sh deployCC -ccn simple -ccp ../../caliper-benchmarks/src/fabric/scenario/simple/node -ccl javascript
npx caliper launch manager --caliper-workspace ./ --caliper-networkconfig networks/fabric/test-network.yaml --caliper-benchconfig benchmarks/scenario/simple/config.yaml --caliper-flow-only-test --caliper-fabric-gateway-enabled
Hyperledger network creation, channel creation and Chaincode deployment all were successful.
How to solve this error?
Looks like you are using the main branch of caliper-benchmarks. I would suggest you https://github.com/hyperledger/caliper-benchmarks/blob/main/networks/fabric/README.md
From what you have posted, you should use the latest available version of caliper which is 0.4.2, not 0.4.0. To do so the command you should issue is
npm install --only=prod #hyperledger/caliper-cli
You should bind to the latest 2.2 sdk (don't bind to 2.1 as fabric doesn't support 2.1). Note this is selecting the version of the sdk used to interact with a fabric network, not the version of the fabric network you are using. 2.2 will work with a fabric 2.2 and later 2.x versions
npx caliper bind --caliper-bind-sut fabric:2.2
Finally it looks like you tried to change the version number in the network configuration file. Don't change the version (it must be 2.0.0) as it refers to the version of the network configuration file and not the version of fabric you want to test
As you look to be using test-network, depending on which branch of fabric-samples you are using defines the version of fabric. The main branch tests the latest version of fabric which should have no problems.

Rollup: Unresolved Dependencies

I'm having issues using npm packages with rollup (specifically lodash).
I'm getting an unresolved dependencies error. I have installed both rollup-plugin-node-resolve and rollup-plugin-commonjs and configured according to the docs. It's possible I could have missed something obvious.
Error
[~/Projects/rollup] yarn run build
yarn run v1.2.1
$ rollup -c
src/main.js → ./build/app.js...
(!) Unresolved dependencies
https://github.com/rollup/rollup/wiki/Troubleshooting#treating-module-as-external-dependency
loadash (imported by src/main.js)
(!) Missing global variable name
Use options.globals to specify browser global variable names corresponding to external modules
loadash (guessing 'loadash')
created ./build/app.js in 47ms
✨ Done in 0.93s.
src/main.js
import { map } from 'loadash';
console.log('Test');
rollup.config.js
import commonjs from 'rollup-plugin-commonjs';
import resolve from 'rollup-plugin-node-resolve';
export default {
input: 'src/main.js',
output: {
file: './build/app.js',
format: 'iife'
},
plugins: [
resolve({
jsnext: true,
main: true,
browser: true,
}),
commonjs()
]
};
What am I doing wrong?
It's called lodash, not loadash!

How I can start IE in 32bit mode in webdriver.io

I am running an WebDriver.io test using gulp-wdio npm pakage
on selenium-standalone
The Code that I run in gulp is:
gulp.task('e2e', function () {
return gulp.src('wdio.conf.js')
.pipe(wdio({
wdio: {
specs: './test/features/**/*.feature'
}
}));
});
And my wdio.conf.js define browsers this way:
capabilities: [
{
browserName: 'internet explorer',
version: 'ANY'
}
],
How ever the typing is very slow, i had found on the internet that running 32 bit version of the web-driver resolves the issue, how ever I can't find how to configure the capabilities or some other place to run the IE32 bit driver by default...
Any help will be appreciated #:-)
After 2 days of research I had found the solution !!!
There is a configuration file that need to be supplied to the selenium standalone
as shown in this Example
so our final setup is done in this way:
We have a configuration file called wdio.browsers.setup.js that contains the browsers setup:
module.exports = {
baseURL: 'https://selenium-release.storage.googleapis.com',
version: '3.3.1',
drivers: {
chrome: {
version: '2.29',
arch: process.arch,
// - Recent versions of the driver: https://sites.google.com/a/chromium.org/chromedriver/
baseURL: 'https://chromedriver.storage.googleapis.com'
},
ie: {
version: '3.0.0',
arch: 'ia32',
// - Recent versions of the driver: http://selenium-release.storage.googleapis.com/index.html
baseURL: 'https://selenium-release.storage.googleapis.com'
},
firefox: {
version: '0.15.0',
arch: process.arch,
baseURL: 'https://github.com/mozilla/geckodriver/releases/download'
}
}
};
and then inside wdio.conf.js we load it and assign to a special parameters
let browsersSetup = require('./wdio.browsers.setup');
exports.config = {
seleniumArgs: browsersSetup,
seleniumInstallArgs: browsersSetup,
After that all is working fine #:-)
Note: if you have your web-driver installed globally remove the global setup first it's located in:
C:\Users\%USERNAME%\AppData\Roaming\npm
Then you can run the local installation using:
./node_modules/.bin/selenium-standalone install --config=../../wdio.browsers.setup.js
Please find the below working solution for IE browser to install 32 bit:
services: ["selenium-standalone"],
seleniumArgs: {
drivers: {`enter code here`
ie: {
version: "3.4.0", // or whatever latest is
arch: "ia32", // forces use of 32 bit driver
baseURL: "https://selenium-release.storage.googleapis.com"
},
},
},
seleniumInstallArgs: {
drivers: {
ie: {
version: "3.4.0", // or whatever latest is
arch: "ia32", // forces use of 32 bit driver
baseURL: "https://selenium-release.storage.googleapis.com"
},
},
},

Sauce Labs OnDemand: multiCapabilities build information is not accepted

We are running mocha nodejs tests with protractor on Sauce Labs and the attribute 'build' is being ignored. This is my protractor.conf.js
multiCapabilities: [
{
name: 'chrome-tests-windows',
browserName: 'chrome',
version: '52',
platform: 'Windows 7',
shardTestFiles: true,
maxInstances: 25,
build: 'solisko-1',
tags: ['tag1', 'tag2']
}]
When I look at the metadata in Sauce Labs Dashboard I see this:
Build null
Tags ["tag1","tag2"]
Browser googlechrome
Browser version 52.0.2743.82
OS Windows 2008
Any idea why the build name is ignored?
I guess, for the build to be populated on Sauce platform. You need to send the below property in Protractor config file. Check here
/** * Use sauceBuild if you want to group test capabilities by a
build ID */
sauceBuild?: string;
I dont see a build option in capabilities object as per the documentation here
From different source I found out that this is the correct attribute:
multiCapabilities: [
{
Build: 'some-build-name',
BuildName: 'some-build-name',
name: 'chrome-tests-mac',
browserName: 'chrome',
version: '52',
platform: 'OS X 10.12',
shardTestFiles: true,
maxInstances: 25
}
]

Error importing Node.js modules into Intern tests

I'm trying out Intern for testing our Node.js modules. I've got it set up to run an empty test and even require node modules, but when I try to require one of the modules in our package I get the error:
/path/to/app/node_modules/path/path.js:327
var path = (i >= 0) ? arguments[i] : process.cwd();
^
TypeError: undefined is not a function
at Object.exports.resolve (/path/to/app/node_modules/path/path.js:327:52)
at Object.exports.relative (/path/to/app/node_modules/path/path.js:405:20)
at getSource (/path/to/app/node_modules/intern/lib/util.js:368:21)
at formatLine (/path/to/app/node_modules/intern/lib/util.js:405:40)
at processChromeTrace (/path/to/app/node_modules/intern/lib/util.js:418:16)
at normalizeStackTrace (/path/to/app/node_modules/intern/lib/util.js:470:38)
at Object.getErrorMessage (/path/to/app/node_modules/intern/lib/util.js:597:14)
at PreExecutor._handleError (/path/to/app/node_modules/intern/lib/executors/PreExecutor.js:256:24)
at /path/to/app/node_modules/intern/node_modules/dojo/lang.js:78:32
at process.<anonymous> (/path/to/app/node_modules/intern/lib/executors/PreExecutor.js:302:6)
Folder structure is:
src/
**/*.coffee
tests
unit/**/*.coffee
intern.js
js/ (coffeescript is compiled here)
src/
**/*.js
tests/
**/*.js
all.js (compiled by rolling up the names of the other tests under /js/tests)
node_modules
Here's my intern.js:
define({
capabilities: {
'browserstack.selenium_version': '2.45.0'
},
environments: [
{browserName: 'internet explorer', version: '11', platform: 'WIN8'},
{browserName: 'internet explorer', version: '10', platform: 'WIN8'},
{browserName: 'internet explorer', version: '9', platform: 'WINDOWS'},
{browserName: 'firefox', version: '37', platform: ['WINDOWS', 'MAC']},
{browserName: 'chrome', version: '39', platform: ['WINDOWS', 'MAC']},
{browserName: 'safari', version: '8', platform: 'MAC'}
],
maxConcurrency: 2,
tunnel: 'BrowserStackTunnel',
loaderOptions: {
packages: [{name: 'app', location: 'js/src'}]
},
reporters: ['Console', 'Lcov'],
suites: ['js/tests/unit/all'],
excludeInstrumentation: /^(?:\.npm|js\/tests|src|tests|node_modules)\//
});
My test is just:
define (require) ->
registerSuite = require('intern!object')
assert = require('intern/chai!assert')
SchemaBuilder = require('intern/dojo/node!app/path/to/Module')
registerSuite
name: 'Testing'
'test': ->
From the project root I'm running './node_modules/.bin/intern-client config=tests/intern'
Is this a problem with my code, configuration, environment, or Intern?
I've tried with Node.js v0.12.0 and v0.12.7.
Interestingly, removing the path module from my app dependencies (package.json) resolved (well, avoided) the undefined is not a function error, seemingly falling back on Intern's own path resolution. I don't really know why, but this seems like a bug.
This presented a new, more tractable error: Error: Cannot find module 'app/path/to/Module', suggesting the path in the require() was simply wrong.
I think the problem is that the intern/dojo/node loader doesn't support the loaderOptions: {packages: [{name: 'app', location: 'js/src'}]} configuration, and hence it is searching for an app directory relative to the test module. If I replace app/ with ../../../../js/src/ then it resolves and works as expected.
It's a bit ugly, but it's the standard way of requiring local files in node, so it's also not too surprising, I had just hoped Intern's loader could make it cleaner.

Resources