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

Fatal error: Unable to parse version string #400

Closed
bohemianoid opened this issue Jun 16, 2016 · 7 comments
Closed

Fatal error: Unable to parse version string #400

bohemianoid opened this issue Jun 16, 2016 · 7 comments
Labels
build-target:windows Bundling an Electron app specifically for Windows invalid ❌ Not related to Electron Packager directly

Comments

@bohemianoid
Copy link

Fatal error: Unable to parse version string when packaging app for platform win32 ia32 using electron v1.2.3 on Windows 8.1 Pro.

Which version of electron-packager are you using?

7.0.4

What CLI arguments are you passing? Alternatively, if you are using the API, what parameters are
you passing to the packager() function?

electron-packager . --out=dist --app-version=$npm_package_version --prune --asar --overwrite --all

What version of Electron are you building with?

1.2.3

What is the host platform are you running electron-packager on?

Windows 8.1 Pro x64

What target platform(s)/architecture(s) are you building for?

--all

Is there a stack trace in the error message you're seeing?

PS C:\Users\simon.roth\Downloads\electron-boilerplate-master\boilerplate> npm run build

> app@0.0.0 build C:\Users\simon.roth\Downloads\electron-boilerplate-master\boilerplate
> electron-packager . --out=dist --app-version=$npm_package_version --prune --asar --overwrite --all

Packaging app for platform linux ia32 using electron v1.2.3
Packaging app for platform win32 ia32 using electron v1.2.3
Fatal error: Unable to parse version string
 undefined

npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run
" "build"
npm ERR! node v4.4.5
npm ERR! npm  v2.15.5
npm ERR! code ELIFECYCLE
npm ERR! app@0.0.0 build: `electron-packager . --out=dist --app-version=$npm_package_version --prune --asar --overwrite
--all`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the app@0.0.0 build script 'electron-packager . --out=dist --app-version=$npm_package_version --prune
 --asar --overwrite --all'.
npm ERR! This is most likely a problem with the app package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     electron-packager . --out=dist --app-version=$npm_package_version --prune --asar --overwrite --all
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs app
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!
npm ERR!     npm owner ls app
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\simon.roth\Downloads\electron-boilerplate-master\boilerplate\npm-debug.log

Please provide either a failing testcase or detailed steps to reproduce your problem.

Can be reproduced by building https://github.com/sindresorhus/electron-boilerplate.

@bohemianoid
Copy link
Author

Possibly related to npm/npm#8574.

@malept
Copy link
Member

malept commented Jun 16, 2016

Try changing the version in package.json from 0.0.0 to 0.0.1.

@malept malept added the needs info Issue reporter needs to provide more information for maintainers to take action label Jun 16, 2016
@adamweeks
Copy link

I am getting the same error when building for win32 on a mac.
electron-packager build/ gifbar --platform=win32 --arch=x64 --overwrite --tmpdir=false --out=releases/ --app-version=0.0.2
I do not get the error if I remove the --app-version param.

@malept malept added the build-target:windows Bundling an Electron app specifically for Windows label Jun 17, 2016
@malept
Copy link
Member

malept commented Jun 17, 2016

I can't reproduce either error.

  • Host platform/arch: Linux x86_64
  • Target platform/arch: Windows x64
  • electron-packager version: 7.0.4
  • Electron version: 1.2.3
  • Wine version: 1.8.2 (32-bit)
  • App versions tried: 0.0.0, 0.0.1, 0.0.2

This error also doesn't occur in our CI tests, which we have for all three platforms.

The error message comes from rcedit. The definition of the version string parser indicates that it should work.

@SimonRoth does the error occur when you build for Windows x64? Are you sure $npm_package_version has a value in it?

@adamweeks Perhaps make sure that your version only contains ASCII? I'm at a loss as to what else to recommend trying here. (I'm assuming you're getting the exact same Unable to parse version string error.)

@bohemianoid
Copy link
Author

bohemianoid commented Jun 17, 2016

Good morning guys. It turned out that the error occures due to different variable substitution on Windows (see npm/npm#8574 and http://blog.keithcirkel.co.uk/how-to-use-npm-as-a-build-tool/#thewindowsproblem). When changing

$npm_package_version to %npm_package_version%

the build passes without errors. It seems that it is not possible to run a build command using variable substitution cross plattform at the moment.

@malept malept added invalid ❌ Not related to Electron Packager directly and removed needs info Issue reporter needs to provide more information for maintainers to take action labels Jun 17, 2016
@malept
Copy link
Member

malept commented Jun 17, 2016

I'm closing this issue then, as the original problem has to do with NPM and not electron-packager.

@malept malept closed this as completed Jun 17, 2016
@bohemianoid
Copy link
Author

Okay, thanks.

NaleRaphael added a commit to NaleRaphael/trello-desktop that referenced this issue Oct 31, 2017
On Windows, project cannot be built sucessfully by original
`package.json`.
There are 2 causes:
1. Different variable substitution (`$npm_package_version to
%npm_package_version%`). See also:
electron/packager#400
2. `zip` command is not supported on Windows, so it is currently removed
to make project be built successfully. (compress output files manually
with `WinRAR`, `7-Zip`... if it is necessay)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build-target:windows Bundling an Electron app specifically for Windows invalid ❌ Not related to Electron Packager directly
Projects
None yet
Development

No branches or pull requests

3 participants