upterm icon indicating copy to clipboard operation
upterm copied to clipboard

npm run pack doesn't work

Open bishoy301 opened this issue 10 years ago • 4 comments

I tried using the npm run pack command to get the standalone application but it failed. My npm and node are up to date. I'm on macOS Sierra.

bishoy301 avatar Oct 01 '16 02:10 bishoy301

Can you post the error message?

drew-gross avatar Oct 01 '16 06:10 drew-gross

Elementary OS 0.4 Liki (based on Ubuntu 16.04) with Node.js v6.6.0 and Typescript 2.0.3:

> [email protected] pack <path>/black-screen
> npm run compile && build


> [email protected] compile <path>/black-screen
> npm run cleanup && npm run tsc && npm run copy-html


> [email protected] cleanup <path>/black-screen
> rm -rf compiled/src


> [email protected] tsc <path>/black-screen
> tsc


> [email protected] copy-html <path>/black-screen
> mkdir -p compiled/src/views && cp src/views/index.html compiled/src/views

CI detected, so artifacts will be published if draft release exists
Warning: Specified application directory "." equals to project dir — superfluous or wrong configuration
Skip app dependencies rebuild because dev and app dependencies are not separated
Packaging for platform linux x64 using electron 1.2.8 to dist/linux-unpacked

Unhandled rejection Error: spawn icns2png ENOENT
    at <path>/black-screen/node_modules/electron-builder/src/util/util.ts:96:16
    at exithandler (child_process.js:213:5)
    at ChildProcess.errorhandler (child_process.js:225:5)
    at emitOne (events.js:96:13)
    at ChildProcess.emit (events.js:188:7)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:213:12)
    at onErrorNT (internal/child_process.js:359:16)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)
    at process._tickCallback (internal/process/next_tick.js:98:9)
From previous event:
    at Object.exec (<path>/black-screen/node_modules/electron-builder/src/util/util.ts:77:3)
    at LinuxTargetHelper.<anonymous> (<path>/black-screen/node_modules/electron-builder/src/targets/LinuxTargetHelper.ts:96:30)
    at next (native)
    at runCallback (timers.js:574:20)
    at tryOnImmediate (timers.js:554:5)
    at processImmediate [as _immediateCallback] (timers.js:533:5)
From previous event:
    at tsAwaiter (<path>/black-screen/node_modules/electron-builder/src/util/awaiter.ts:10:47)
    at Object.build (<path>/black-screen/node_modules/electron-builder/out/builder.js:153:12)
    at Object.<anonymous> (<path>/black-screen/node_modules/electron-builder/out/build-cli.js:23:11)
    at Module._compile (module.js:556:32)
    at Object.Module._extensions..js (module.js:565:10)
    at Module.load (module.js:473:32)
    at tryModuleLoad (module.js:432:12)
    at Function.Module._load (module.js:424:3)
    at Module.runMain (module.js:590:10)
    at run (bootstrap_node.js:394:7)
    at startup (bootstrap_node.js:149:9)
    at bootstrap_node.js:509:3

Error: spawn icns2png ENOENT
    at <path>/black-screen/node_modules/electron-builder/src/util/util.ts:96:16
    at exithandler (child_process.js:213:5)
    at ChildProcess.errorhandler (child_process.js:225:5)
    at emitOne (events.js:96:13)
    at ChildProcess.emit (events.js:188:7)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:213:12)
    at onErrorNT (internal/child_process.js:359:16)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)
    at process._tickCallback (internal/process/next_tick.js:98:9)
From previous event:
    at Object.exec (<path>/black-screen/node_modules/electron-builder/src/util/util.ts:77:3)
    at LinuxTargetHelper.<anonymous> (<path>/black-screen/node_modules/electron-builder/src/targets/LinuxTargetHelper.ts:96:30)
    at next (native)
    at runCallback (timers.js:574:20)
    at tryOnImmediate (timers.js:554:5)
    at processImmediate [as _immediateCallback] (timers.js:533:5)
From previous event:
    at tsAwaiter (<path>/black-screen/node_modules/electron-builder/src/util/awaiter.ts:10:47)
    at Object.build (<path>/black-screen/node_modules/electron-builder/out/builder.js:153:12)
    at Object.<anonymous> (<path>/black-screen/node_modules/electron-builder/out/build-cli.js:23:11)
    at Module._compile (module.js:556:32)
    at Object.Module._extensions..js (module.js:565:10)
    at Module.load (module.js:473:32)
    at tryModuleLoad (module.js:432:12)
    at Function.Module._load (module.js:424:3)
    at Module.runMain (module.js:590:10)
    at run (bootstrap_node.js:394:7)
    at startup (bootstrap_node.js:149:9)
    at bootstrap_node.js:509:3

npm ERR! Linux 4.4.0-38-generic
npm ERR! argv "/home/yordan/.nvm/versions/node/v6.6.0/bin/node" "/home/yordan/.nvm/versions/node/v6.6.0/bin/npm" "run" "pack"
npm ERR! node v6.6.0
npm ERR! npm  v3.10.3
npm ERR! code ELIFECYCLE
npm ERR! [email protected] pack: `npm run compile && build`
npm ERR! Exit status 255
npm ERR! 
npm ERR! Failed at the [email protected] pack script 'npm run compile && 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 black-screen package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     npm run compile && build
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs black-screen
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls black-screen
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     <path>/black-screen/npm-debug.log

Log file:

0 info it worked if it ends with ok
1 verbose cli [ '<home>/.nvm/versions/node/v6.6.0/bin/node',
1 verbose cli   '<home>/.nvm/versions/node/v6.6.0/bin/npm',
1 verbose cli   'run',
1 verbose cli   'pack' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prepack', 'pack', 'postpack' ]
5 info lifecycle [email protected]~prepack: [email protected]
6 silly lifecycle [email protected]~prepack: no script for prepack, continuing
7 info lifecycle [email protected]~pack: [email protected]
8 verbose lifecycle [email protected]~pack: unsafe-perm in lifecycle true
9 verbose lifecycle [email protected]~pack: PATH: <home>/.nvm/versions/node/v6.6.0/lib/node_modules/npm/bin/node-gyp-bin:<home>/workspace/black-screen/node_modules/.bin:<home>/.nvm/versions/node/v6.6.0/bin:<home>/.applications/android/sdk/platform-tools:<home>/.applications/android/sdk/tools:<home>/.applications/miniconda/bin:<home>/.nvm/versions/node/v6.6.0/bin:<home>/bin:<home>/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:<home>/.composer/vendor/bin
10 verbose lifecycle [email protected]~pack: CWD: <home>/workspace/black-screen
11 silly lifecycle [email protected]~pack: Args: [ '-c', 'npm run compile && build' ]
12 silly lifecycle [email protected]~pack: Returned: code: 255  signal: null
13 info lifecycle [email protected]~pack: Failed to exec pack script
14 verbose stack Error: [email protected] pack: `npm run compile && build`
14 verbose stack Exit status 255
14 verbose stack     at EventEmitter.<anonymous> (<home>/.nvm/versions/node/v6.6.0/lib/node_modules/npm/lib/utils/lifecycle.js:242:16)
14 verbose stack     at emitTwo (events.js:106:13)
14 verbose stack     at EventEmitter.emit (events.js:191:7)
14 verbose stack     at ChildProcess.<anonymous> (<home>/.nvm/versions/node/v6.6.0/lib/node_modules/npm/lib/utils/spawn.js:40:14)
14 verbose stack     at emitTwo (events.js:106:13)
14 verbose stack     at ChildProcess.emit (events.js:191:7)
14 verbose stack     at maybeClose (internal/child_process.js:877:16)
14 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
15 verbose pkgid [email protected]
16 verbose cwd <home>/workspace/black-screen
17 error Linux 4.4.0-38-generic
18 error argv "<home>/.nvm/versions/node/v6.6.0/bin/node" "<home>/.nvm/versions/node/v6.6.0/bin/npm" "run" "pack"
19 error node v6.6.0
20 error npm  v3.10.3
21 error code ELIFECYCLE
22 error [email protected] pack: `npm run compile && build`
22 error Exit status 255
23 error Failed at the [email protected] pack script 'npm run compile && build'.
23 error Make sure you have the latest version of node.js and npm installed.
23 error If you do, this is most likely a problem with the black-screen package,
23 error not with npm itself.
23 error Tell the author that this fails on your system:
23 error     npm run compile && build
23 error You can get information on how to open an issue for this project with:
23 error     npm bugs black-screen
23 error Or if that isn't available, you can get their info via:
23 error     npm owner ls black-screen
23 error There is likely additional logging output above.
24 verbose exit [ 1, true ]

ivanovyordan avatar Oct 04 '16 18:10 ivanovyordan

That seems to be a problem with electron-builder and icns2png being missing.

drew-gross avatar Oct 04 '16 19:10 drew-gross

I was able to fix this on Ubuntu 14.04 by running

sudo apt-get install --no-install-recommends -y icnsutils graphicsmagick xz-utils

See https://github.com/electron-userland/electron-builder/wiki/Multi-Platform-Build#linux.

jamesob avatar May 27 '17 19:05 jamesob