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

Please provide a snap package #450

Closed
0xBADEAFFE opened this issue Nov 22, 2016 · 6 comments
Closed

Please provide a snap package #450

0xBADEAFFE opened this issue Nov 22, 2016 · 6 comments
Assignees
Labels
Build ◦ Desktop Specific to desktop Build ◦ Linux Specific to Linux › Dist Installers and other forms of software distribution Type ◦ Enhancement Improves an existing feature
Milestone

Comments

@0xBADEAFFE
Copy link

It would be great if you could provide a snap package for keeweb. Instructions are here: http://snapcraft.io/.

@antelle antelle added Build ◦ Desktop Specific to desktop › Dist Installers and other forms of software distribution Build ◦ Linux Specific to Linux labels Nov 23, 2016
@antelle antelle added this to the Future milestone Nov 23, 2016
@owais
Copy link

owais commented Jul 15, 2017

This would be really great. A deb or ppa package would be nice as well but creating a snap is much simpler and it can work on all distros.

@piclemx
Copy link

piclemx commented Sep 17, 2017

It's will give you more visibility with this feature.

@pedzed
Copy link

pedzed commented Jul 30, 2018

Any update on this?

@jasperweiss
Copy link

This would be great since snaps also sandbox the application. Snaps finally allow for a somewhat trusted Linux desktop system. (assuming Wayland is used as the display server, rather than X11)

@gustawdaniel
Copy link

I found tutorial how tho add snap

https://docs.snapcraft.io/electron-apps/6748

I go through process of running this project on my local machine #1035 and #1038

Then after command npm run dist had error

  ⨯ snapcraft is not installed, please: sudo snap install snapcraft --classic

Fexed by

sudo snap install snapcraft --classic

that installed version

snapcraft 2.43.1 from Canonical✓ installed

And again had error

> keeweb@1.6.3 dist /home/daniel/exp/keeweb
> build --linux snap

  • electron-builder version=20.36.2
  • writing effective config file=dist/builder-effective-config.yaml
  • rebuilding native production dependencies platform=linux arch=x64
  • packaging       platform=linux arch=x64 electron=1.8.8 appOutDir=dist/linux-unpacked
  • building        target=snap arch=x64 file=dist/keeweb_1.6.3_amd64.snap
  • default Electron icon is used reason=application icon is not set
  • application Linux category is set to default "Utility" reason=linux.category is not set and cannot map from macOS docs=https://electron.build/configuration/configuration#LinuxBuildOptions-category
  ⨯ at least snapcraft 2.40.0 is required, please: sudo snap install snapcraft --classic
Error: /home/daniel/exp/keeweb/node_modules/app-builder-bin/linux/x64/app-builder exited with code 1
    at ChildProcess.childProcess.once.code (/home/daniel/exp/keeweb/node_modules/builder-util/src/util.ts:244:14)
    at Object.onceWrapper (events.js:317:30)
    at emitTwo (events.js:126:13)
    at ChildProcess.emit (events.js:214:7)
    at maybeClose (internal/child_process.js:925:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
From previous event:
    at SnapTarget.build (/home/daniel/exp/keeweb/node_modules/app-builder-lib/src/targets/snap.ts:146:44)
    at Function.buildAsyncTargets (/home/daniel/exp/keeweb/node_modules/app-builder-lib/src/platformPackager.ts:140:36)
    at LinuxPackager.packageInDistributableFormat (/home/daniel/exp/keeweb/node_modules/app-builder-lib/src/platformPackager.ts:119:24)
    at /home/daniel/exp/keeweb/node_modules/app-builder-lib/src/platformPackager.ts:114:10
    at Generator.next (<anonymous>)
    at runCallback (timers.js:794:20)
    at tryOnImmediate (timers.js:752:5)
    at processImmediate [as _immediateCallback] (timers.js:729:5)
From previous event:
    at LinuxPackager.pack (/home/daniel/exp/keeweb/node_modules/app-builder-lib/src/platformPackager.ts:111:95)
    at /home/daniel/exp/keeweb/node_modules/app-builder-lib/src/packager.ts:406:24
    at Generator.next (<anonymous>)
    at xfs.stat (/home/daniel/exp/keeweb/node_modules/fs-extra-p/node_modules/fs-extra/lib/mkdirs/mkdirs.js:56:16)
    at /home/daniel/exp/keeweb/node_modules/graceful-fs/polyfills.js:287:18
    at FSReqWrap.oncomplete (fs.js:153:5)
From previous event:
    at Packager.doBuild (/home/daniel/exp/keeweb/node_modules/app-builder-lib/src/packager.ts:372:24)
    at /home/daniel/exp/keeweb/node_modules/app-builder-lib/src/packager.ts:342:57
    at Generator.next (<anonymous>)
    at /home/daniel/exp/keeweb/node_modules/graceful-fs/graceful-fs.js:99:16
    at /home/daniel/exp/keeweb/node_modules/graceful-fs/graceful-fs.js:43:10
    at FSReqWrap.oncomplete (fs.js:135:15)
From previous event:
    at Packager._build (/home/daniel/exp/keeweb/node_modules/app-builder-lib/src/packager.ts:311:133)
    at /home/daniel/exp/keeweb/node_modules/app-builder-lib/src/packager.ts:307:23
    at Generator.next (<anonymous>)
    at runCallback (timers.js:794:20)
    at tryOnImmediate (timers.js:752:5)
    at processImmediate [as _immediateCallback] (timers.js:729:5)
From previous event:
    at Packager.build (/home/daniel/exp/keeweb/node_modules/app-builder-lib/src/packager.ts:264:14)
    at build (/home/daniel/exp/keeweb/node_modules/app-builder-lib/src/index.ts:59:28)
    at build (/home/daniel/exp/keeweb/node_modules/electron-builder/src/builder.ts:227:10)
    at then (/home/daniel/exp/keeweb/node_modules/electron-builder/src/cli/cli.ts:46:19)
    at <anonymous>
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! keeweb@1.6.3 dist: `build --linux snap`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the keeweb@1.6.3 dist script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/daniel/.npm/_logs/2018-11-18T02_28_01_444Z-debug.log

For example from page

https://docs.snapcraft.io/electron-apps/6748

everything works great. So where is the difference?

On website electron in in version 2.0.0, but in repository

https://github.com/electron/electron-quick-start

electron have version 3.0.4

I will try update it and give feedback. If anyone know how consequences can have updating electron please share your knowledge there.

@gustawdaniel
Copy link

gustawdaniel commented Nov 18, 2018

In this project there is used electron 1.8.8 in develop branch.

update in branch develop is 1.7.9, I updated to 1.8.8 in my other branch

This is website about migration

https://electronjs.org/blog/electron-2-0

After update to v2 I got error

Local Npm module "grunt-appdmg" not found. Is it installed?

and

ls node_modules/grunt-appdmg
ls: cannot access 'node_modules/grunt-appdmg': No such file or directory

So after website

https://www.npmjs.com/package/grunt-appdmg

I installed by

npm install grunt-appdmg --save-dev

In this project it was in optional dependencies.

and had error

 Unsupported platform for grunt-appdmg@0.4.0: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

I can find similar error in logs from #935

this error was mentioned also there npm/npm#11973 so I tried recommended

npm update --depth 999

without effect. If I want install grunt-appdmg I still have

npm WARN deprecated cross-spawn-async@2.2.5: cross-spawn no longer requires a build toolchain, use it instead
npm ERR! code EBADPLATFORM
npm ERR! notsup Unsupported platform for grunt-appdmg@0.4.0: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm ERR! notsup Valid OS:    darwin
npm ERR! notsup Valid Arch:  any
npm ERR! notsup Actual OS:   linux
npm ERR! notsup Actual Arch: x64

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/daniel/.npm/_logs/2018-11-18T03_00_24_691Z-debug.log

Anyway npm run dev works and displays finally

    webpack: Compiled successfully.

and

npm run electron

works too. I think we can update README again and put them run instead of run-script and npm run dev insead grunt dev because of anyone can have different version of grunt, and for example I do not have it installed globally.

Unfortunatelly I afraid to develop it without tests. Now testa are broken.

npm test

> keeweb@1.6.3 test /home/daniel/exp/keeweb
> grunt test

>> Local Npm module "grunt-appdmg" not found. Is it installed?
Warning: Task "test" not found. Use --force to continue.

Aborted due to warnings.


Execution Time (2018-11-18 04:13:13 UTC+1)
loading tasks  2.8s  ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 100%
Total 2.8s

npm ERR! Test failed.  See above for more details.

I commit my changes and come back to master and check there. In master npm i does not works.

binding.target.mk:115: recipe for target 'Release/obj.target/binding/src/binding.o' failed
make: *** [Release/obj.target/binding/src/binding.o] Error 1
make: Leaving directory '/home/daniel/exp/keeweb/node_modules/node-sass/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/home/daniel/exp/keeweb/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack     at ChildProcess.emit (events.js:182:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:237:12)
gyp ERR! System Linux 4.15.0-39-generic
gyp ERR! command "/home/daniel/.nvm/versions/node/v10.7.0/bin/node" "/home/daniel/exp/keeweb/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /home/daniel/exp/keeweb/node_modules/node-sass
gyp ERR! node -v v10.7.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 
Build failed with error code: 1
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: grunt-appdmg@0.4.0 (node_modules/grunt-appdmg):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for grunt-appdmg@0.4.0: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: appdmg@0.4.5 (node_modules/appdmg):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for appdmg@0.4.5: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: iltorb@1.0.13 (node_modules/iltorb):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: iltorb@1.0.13 install: `node-gyp rebuild`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: keytar@4.0.3 (node_modules/keytar):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: keytar@4.0.3 install: `node-gyp rebuild`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@4.5.3 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the node-sass@4.5.3 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/daniel/.npm/_logs/2018-11-18T03_18_27_601Z-debug.log
rm -rf node_modules

fixed problem.

There was errors

Downloading binary from https://github.com/sass/node-sass/releases/download/v4.5.3/linux-x64-64_binding.node
Cannot download "https://github.com/sass/node-sass/releases/download/v4.5.3/linux-x64-64_binding.node": 

HTTP error 404 Not Found

Hint: If github.com is not accessible in your location
      try setting a proxy via HTTP_PROXY, e.g. 

      export HTTP_PROXY=http://example.com:1234

or configure npm proxy via

      npm config set proxy http://example.com:8080

> keytar@4.0.3 install /home/daniel/exp/keeweb/node_modules/keytar
> node-gyp rebuild

make: Entering directory '/home/daniel/exp/keeweb/node_modules/keytar/build'
  CXX(target) Release/obj.target/keytar/src/async.o
In file included from ../../nan/nan.h:190:0,
                 from ../src/async.cc:3:
../../nan/nan_maybe_43_inl.h: In function ‘Nan::Maybe<bool> Nan::ForceSet(v8::Local<v8::Object>, v8::Local<v8::Value>, v8::Local<v8::Value>, v8::PropertyAttribute)’:
../../nan/nan_maybe_43_inl.h:112:15: error: ‘class v8::Object’ has no member named ‘ForceSet’
   return obj->ForceSet(isolate->GetCurrentContext(), key, value, attribs);
               ^~~~~~~~
keytar.target.mk:103: recipe for target 'Release/obj.target/keytar/src/async.o' failed
make: *** [Release/obj.target/keytar/src/async.o] Error 1
make: Leaving directory '/home/daniel/exp/keeweb/node_modules/keytar/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/home/daniel/.nvm/versions/node/v10.7.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack     at ChildProcess.emit (events.js:182:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:237:12)
gyp ERR! System Linux 4.15.0-39-generic
gyp ERR! command "/home/daniel/.nvm/versions/node/v10.7.0/bin/node" "/home/daniel/.nvm/versions/node/v10.7.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/daniel/exp/keeweb/node_modules/keytar
gyp ERR! node -v v10.7.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 

I cant understood why on master npm i does not work bug give errors

gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/home/daniel/exp/keeweb/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack     at ChildProcess.emit (events.js:182:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:237:12)
gyp ERR! System Linux 4.15.0-39-generic
gyp ERR! command "/home/daniel/.nvm/versions/node/v10.7.0/bin/node" "/home/daniel/exp/keeweb/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /home/daniel/exp/keeweb/node_modules/node-sass
gyp ERR! node -v v10.7.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 
Build failed with error code: 1
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: grunt-appdmg@0.4.0 (node_modules/grunt-appdmg):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for grunt-appdmg@0.4.0: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: iltorb@1.0.13 (node_modules/iltorb):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: iltorb@1.0.13 install: `node-gyp rebuild`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: keytar@4.0.3 (node_modules/keytar):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: keytar@4.0.3 install: `node-gyp rebuild`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@4.5.3 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the node-sass@4.5.3 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/daniel/.npm/_logs/2018-11-18T03_23_19_537Z-debug.log

Can it be connected with migration to node 10 from 8 when I first time run master? I do not know.

On develop npm i works... npm run dev too, and npm run electron not...

> keeweb@1.6.3 electron /home/daniel/exp/keeweb
> electron desktop --htmlpath=http://localhost:8085/tmp/

/home/daniel/exp/keeweb/node_modules/electron/index.js:9
  throw new Error('Electron failed to install correctly, please delete node_modules/electron and try installing again')
  ^

Error: Electron failed to install correctly, please delete node_modules/electron and try installing again
    at Object.<anonymous> (/home/daniel/exp/keeweb/node_modules/electron/index.js:9:9)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at Object.<anonymous> (/home/daniel/exp/keeweb/node_modules/electron/cli.js:3:16)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! keeweb@1.6.3 electron: `electron desktop --htmlpath=http://localhost:8085/tmp/`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the keeweb@1.6.3 electron script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/daniel/.npm/_logs/2018-11-18T03_31_06_587Z-debug.log

I see. I updated electron before by simple npm update

git diff 685d74855df4323d539343f3b1480fca0cedc4cc..747b0e46d9a1f96e78ae5c532f75a6b1650b7e9d package.json
diff --git a/package.json b/package.json
index 805bfbf..a395ae8 100644
--- a/package.json
+++ b/package.json
@@ -20,11 +20,11 @@
     "base64-loader": "1.0.0",
     "bourbon": "4.2.7",
     "cssnano": "3.10.0",
-    "electron": "^1.7.9",
+    "electron": "^1.8.8",
     "eslint": "^3.19.0",
     "eslint-config-standard": "10.2.1",
-    "eslint-plugin-import": "^2.3.0",
-    "eslint-plugin-node": "^5.0.0",
+    "eslint-plugin-import": "^2.14.0",
+    "eslint-plugin-node": "^5.2.1",
     "eslint-plugin-promise": "3.5.0",
     "eslint-plugin-standard": "3.0.1",
     "exports-loader": "0.6.4",
@@ -56,7 +56,7 @@
     "jsqrcode": "github:antelle/jsqrcode#0.1.3",
     "kdbxweb": "1.2.2",
     "load-grunt-tasks": "3.5.2",
-    "node-sass": "^4.5.3",
+    "node-sass": "^4.10.0",
     "node-stream-zip": "1.3.7",
     "normalize.css": "5.0.0",
     "pikaday": "1.5.1",
@@ -68,8 +68,8 @@
     "sumchecker": "^2.0.2",
     "time-grunt": "1.4.0",
     "uglify-loader": "2.0.0",
-    "webpack": "^2.6.1",
-    "webpack-dev-server": "^2.4.5"
+    "webpack": "^2.7.0",
+    "webpack-dev-server": "^2.11.3"
   },
   "optionalDependencies": {
     "grunt-appdmg": "0.4.0",

because of downgrades in package-lock.json...

rm -rf node_modules && npm install

Anyway I come back to develop branch and npm run test still not works. In package.json there is

  "scripts": {
    "start": "grunt",
    "test": "grunt test",

but in Gruntfile.js

only test words are in webpack config. No taks test is registered.

So i propose
a) add tests
b) remove line "test": "grunt test", from package.json
c) write docs about using tests if there are tests added in other way

I checked and even without updates snap throw the same error

npm run dist

> keeweb@1.6.3 dist /home/daniel/exp/keeweb
> build --linux snap

  • electron-builder version=20.36.2
  • writing effective config file=dist/builder-effective-config.yaml
  • rebuilding native production dependencies platform=linux arch=x64
  • packaging       platform=linux arch=x64 electron=1.7.9 appOutDir=dist/linux-unpacked
  • downloading               parts=8 size=51 MB url=https://github.com/electron/electron/releases/download/v1.7.9/electron-v1.7.9-linux-x64.zip
  • downloaded                duration=14.168s url=https://github.com/electron/electron/releases/download/v1.7.9/electron-v1.7.9-linux-x64.zip
  • building        target=snap arch=x64 file=dist/keeweb_1.6.3_amd64.snap
  • default Electron icon is used reason=application icon is not set
  • application Linux category is set to default "Utility" reason=linux.category is not set and cannot map from macOS docs=https://electron.build/configuration/configuration#LinuxBuildOptions-category
  ⨯ at least snapcraft 2.40.0 is required, please: sudo snap install snapcraft --classic
Error: /home/daniel/exp/keeweb/node_modules/app-builder-bin/linux/x64/app-builder exited with code 1
    at ChildProcess.childProcess.once.code (/home/daniel/exp/keeweb/node_modules/builder-util/src/util.ts:244:14)
    at Object.onceWrapper (events.js:273:13)
    at ChildProcess.emit (events.js:182:13)
    at maybeClose (internal/child_process.js:961:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:248:5)
From previous event:
    at SnapTarget.build (/home/daniel/exp/keeweb/node_modules/app-builder-lib/src/targets/snap.ts:146:44)
    at Function.buildAsyncTargets (/home/daniel/exp/keeweb/node_modules/app-builder-lib/src/platformPackager.ts:140:36)
    at LinuxPackager.packageInDistributableFormat (/home/daniel/exp/keeweb/node_modules/app-builder-lib/src/platformPackager.ts:119:24)
    at /home/daniel/exp/keeweb/node_modules/app-builder-lib/src/platformPackager.ts:114:10
    at Generator.next (<anonymous>)
    at runCallback (timers.js:696:18)
    at tryOnImmediate (timers.js:667:5)
    at processImmediate (timers.js:649:5)
From previous event:
    at LinuxPackager.pack (/home/daniel/exp/keeweb/node_modules/app-builder-lib/src/platformPackager.ts:111:95)
    at /home/daniel/exp/keeweb/node_modules/app-builder-lib/src/packager.ts:406:24
    at Generator.next (<anonymous>)
    at xfs.stat (/home/daniel/exp/keeweb/node_modules/fs-extra-p/node_modules/fs-extra/lib/mkdirs/mkdirs.js:56:16)
    at /home/daniel/exp/keeweb/node_modules/graceful-fs/polyfills.js:287:18
    at FSReqWrap.oncomplete (fs.js:159:5)
From previous event:
    at Packager.doBuild (/home/daniel/exp/keeweb/node_modules/app-builder-lib/src/packager.ts:372:24)
    at /home/daniel/exp/keeweb/node_modules/app-builder-lib/src/packager.ts:342:57
    at Generator.next (<anonymous>)
    at /home/daniel/exp/keeweb/node_modules/graceful-fs/graceful-fs.js:99:16
    at /home/daniel/exp/keeweb/node_modules/graceful-fs/graceful-fs.js:43:10
    at FSReqWrap.oncomplete (fs.js:145:20)
From previous event:
    at Packager._build (/home/daniel/exp/keeweb/node_modules/app-builder-lib/src/packager.ts:311:133)
    at /home/daniel/exp/keeweb/node_modules/app-builder-lib/src/packager.ts:307:23
    at Generator.next (<anonymous>)
    at runCallback (timers.js:696:18)
    at tryOnImmediate (timers.js:667:5)
    at processImmediate (timers.js:649:5)
From previous event:
    at Packager.build (/home/daniel/exp/keeweb/node_modules/app-builder-lib/src/packager.ts:264:14)
    at build (/home/daniel/exp/keeweb/node_modules/app-builder-lib/src/index.ts:59:28)
    at build (/home/daniel/exp/keeweb/node_modules/electron-builder/src/builder.ts:227:10)
    at then (/home/daniel/exp/keeweb/node_modules/electron-builder/src/cli/cli.ts:46:19)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! keeweb@1.6.3 dist: `build --linux snap`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the keeweb@1.6.3 dist script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/daniel/.npm/_logs/2018-11-18T04_04_18_696Z-debug.log

So I will find problem in other place. In repository https://github.com/electron-userland/electron-builder
there are not reported problems with backward compatibility.

But in docs of electron

./node_modules/.bin/electron --help
Electron 1.7.9 - Build cross platform desktop apps with JavaScript, HTML, and CSS

  Usage: electron [options] [path]

  A path to an Electron app may be specified. The path must be one of the following:

    - index.js file.
    - Folder containing a package.json file.
    - Folder containing an index.js file.
    - .html/.htm file.
    - http://, https://, or file:// URL.

  Options:
    -h, --help            Print this usage message.
    -i, --interactive     Open a REPL to the main process.
    -r, --require         Module to preload (option can be repeated)
    -v, --version         Print the version.
    --abi                 Print the application binary interface.

there is explained that command electron desktop --htmlpath=http://localhost:8085/tmp/ run by npm run electron means that project is in directory desktop. Ok so in docs of snap I can find proper flag

When I run

./node_modules/.bin/build --linux snap --project desktop

I get error

  • electron-builder version=20.36.2
  • writing effective config file=desktop/dist/builder-effective-config.yaml
  • no native production dependencies
  • packaging       platform=linux arch=x64 electron=3.0.9 appOutDir=desktop/dist/linux-unpacked
  • downloading               parts=8 size=52 MB url=https://github.com/electron/electron/releases/download/v3.0.9/electron-v3.0.9-linux-x64.zip
  • downloaded                duration=33.686s url=https://github.com/electron/electron/releases/download/v3.0.9/electron-v3.0.9-linux-x64.zip
  • building        target=snap arch=x64 file=desktop/dist/KeeWeb_1.6.3_amd64.snap
  • default Electron icon is used reason=application icon is not set
image /home/daniel/exp/keeweb/desktop/icon.png must be at least 256x256

And size of image is too small

 file  /home/daniel/exp/keeweb/desktop/icon.png
/home/daniel/exp/keeweb/desktop/icon.png: PNG image data, 128 x 128, 8-bit/color RGBA, non-interlaced

So temporary I resize

 convert desktop/icon.png -resize 256x256 desktop/icon.png

But bettet to find svg and create icon correctly and... Wow! It works. I created my first snap.

./node_modules/.bin/build --linux snap --project desktop.

Summary

To build snap you should run command

npm run dist

And you should see file

ls desktop/dist/KeeWeb_*_amd64.snap

@antelle antelle added the Type ◦ Enhancement Improves an existing feature label Jan 7, 2019
@antelle antelle modified the milestones: Future, v1.13 Oct 27, 2019
@antelle antelle self-assigned this Mar 17, 2020
@antelle antelle closed this as completed in be3c7a8 Apr 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Build ◦ Desktop Specific to desktop Build ◦ Linux Specific to Linux › Dist Installers and other forms of software distribution Type ◦ Enhancement Improves an existing feature
Projects
None yet
Development

No branches or pull requests

7 participants