hardchor / timesheets

Time tracking done right
http://burgiblog.com/timesheets/
MIT License
98 stars 22 forks source link

Package app for windows #33

Open ghost opened 8 years ago

MrBlenny commented 8 years ago

I'm trying to run npm pack on windows but i'm getting an error:

> Timesheets@0.0.1 build-main C:\Git\timesheets
> cross-env NODE_ENV=production node -r babel-register ./node_modules/webpack/bin/webpack --config webpack.config.electron.js --progress --profile --colors && cp app/package.json dist/

3436ms build modules
27ms seal
17ms optimize
18ms hashing
57ms create chunk assets
6440ms additional chunk assets
1ms optimize chunk assets
1ms optimize assets
173ms emit
Hash: 9cf171c36a4b82523b9b
Version: webpack 1.13.1
Time: 10176ms
   Asset    Size  Chunks             Chunk Names
index.js  857 kB       0  [emitted]  main
   [0] multi main 40 bytes {0} [built]
       factory:0ms building:1ms = 1ms
    + 1025 hidden modules

WARNING in ./app/~/encoding/lib/iconv-loader.js
Critical dependencies:
9:12-34 the request of a dependency is an expression
 @ ./app/~/encoding/lib/iconv-loader.js 9:12-34

> Timesheets@0.0.1 build-renderer C:\Git\timesheets
> cross-env NODE_ENV=production node -r babel-register ./node_modules/webpack/bin/webpack --config webpack.config.production.js --progress --profile --colors && cp -R app/renderer/assets dist/renderer

7584ms build modules
22ms seal
72ms optimize
38ms hashing
88ms create chunk assets
15316ms additional chunk assets
1ms optimize chunk assets
1ms optimize assets
182ms emit
Hash: e64d11543d313eb2b61a
Version: webpack 1.13.1
Time: 23311ms
            Asset     Size  Chunks             Chunk Names
    main/index.js  1.23 MB       0  [emitted]  main
 menubar/index.js  1.01 MB       1  [emitted]  menubar
   main/style.css   427 kB       0  [emitted]  main
menubar/style.css   426 kB       1  [emitted]  menubar
   [0] multi menubar 40 bytes {1} [built]
       factory:0ms building:1ms dependencies:75ms = 76ms
   [0] multi main 40 bytes {0} [built]
       factory:0ms building:1ms = 1ms
    + 1290 hidden modules

WARNING in ./app/~/encoding/lib/iconv-loader.js
Critical dependencies:
9:12-34 the request of a dependency is an expression
 @ ./app/~/encoding/lib/iconv-loader.js 9:12-34
Child extract-text-webpack-plugin:
        + 8 hidden modules
Child extract-text-webpack-plugin:
        + 2 hidden modules
Child extract-text-webpack-plugin:
        + 2 hidden modules
Child extract-text-webpack-plugin:
        + 2 hidden modules
Child extract-text-webpack-plugin:
        + 2 hidden modules
Child extract-text-webpack-plugin:
        + 2 hidden modules
Child extract-text-webpack-plugin:
        + 2 hidden modules
Child extract-text-webpack-plugin:
        + 2 hidden modules
Child extract-text-webpack-plugin:
        + 2 hidden modules
Child extract-text-webpack-plugin:
        + 2 hidden modules
'.' is not recognized as an internal or external command,
operable program or batch file.

npm ERR! Windows_NT 10.0.10586
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\david\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "run" "pack"
npm ERR! node v6.2.1
npm ERR! npm  v3.10.6
npm ERR! code ELIFECYCLE
npm ERR! Timesheets@0.0.1 pack: `npm run build && ./node_modules/.bin/build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the Timesheets@0.0.1 pack script 'npm run build && ./node_modules/.bin/build'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the Timesheets package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     npm run build && ./node_modules/.bin/build
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs Timesheets
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls Timesheets
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Git\timesheets\npm-debug.log

Any ideas?

ghost commented 8 years ago

I've not had the chance to build this on a windows machine yet. Can you run npm run build without a problem? What about npm run dev? Any issues?

MrBlenny commented 8 years ago

Yep, npm run build and npm run dev work fine. I'm trying to compile the app for Linux, Windows and OS X. I know this sort of compilation works in the https://github.com/chentsulin/electron-react-boilerplate with npm run package-all. Has that build process been completely removed?

ghost commented 8 years ago

Yes, I've started using https://github.com/electron-userland/electron-builder instead. I'm a little tied up at work at the moment. Please let me know if you find anything on there.

MrBlenny commented 8 years ago

I've got it compiling the .exe. I was unfamiliar with electron builder so it took a while.

I set up a script as follows:

"use strict"

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

builder.build({
  targets: Platform.WINDOWS.createTarget(),
  devMetadata: {
    "//": "build and other properties, see https://goo.gl/5jVxoO"
  }
})

Running that produces a packaged .exe in timesheets\release\win\Timesheets Setup 1.3.0.exe. This works perfectly on Windows 10 :)

ghost commented 8 years ago

Great stuff, will give this a go after work. https://github.com/hardchor/timesheets/blob/master/package.json#L98-L120 is where the build config currently lives.

ghost commented 8 years ago

Hey @MrBlenny ! I've still not had the chance to test this on an actual Windows machine. Did you manage to get your solution working in the build process?

MrBlenny commented 8 years ago

I got it working with the script posted above.

hardchor commented 8 years ago

note to self: Check https://github.com/electron-userland/electron-builder/wiki/Options#buildwin to build locally, check out AppVeyor for production build

Spenhouet commented 4 years ago

I can't even do yarn install after cloning this repro on Windows. I get an infinite stack trace (doesn't stop throwing errors).