question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error code sign for Mac

See original GitHub issue
  • Version: 15.0.0
  • Target: mac

Build without code sign is OK. When add developer id application and do code sign, it will be failed with list below error:

Error: Command failed: codesign --sign Developer ID Application: Minghai Zhao (************) --force /Users/minghaizhao/WebstormProjects/databright/dist/mac/DataBright.app/Contents/Resources/app.asar.unpacked/node_modules/phantomjs/lib/phantom/bin/phantomjs
/Users/minghaizhao/WebstormProjects/databright/dist/mac/DataBright.app/Contents/Resources/app.asar.unpacked/node_modules/phantomjs/lib/phantom/bin/phantomjs: main executable failed strict validation

    at ChildProcess.exithandler (child_process.js:206:12)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at maybeClose (internal/child_process.js:877:16)
    at Socket.<anonymous> (internal/child_process.js:334:11)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at Pipe._handle.close [as _onclose] (net.js:498:12)
From previous event:
    at MacPackager.sign (/Users/minghaizhao/WebstormProjects/databright/node_modules/electron-builder/out/macPackager.js:272:11)
    at /Users/minghaizhao/WebstormProjects/databright/node_modules/electron-builder/src/macPackager.ts:82:26
    at runCallback (timers.js:651:20)
    at tryOnImmediate (timers.js:624:5)
    at processImmediate [as _immediateCallback] (timers.js:596:5)
From previous event:
    at /Users/minghaizhao/WebstormProjects/databright/node_modules/electron-builder/src/macPackager.ts:82:10
    at next (native)
From previous event:
    at MacPackager.pack (/Users/minghaizhao/WebstormProjects/databright/node_modules/electron-builder/out/macPackager.js:181:11)
    at /Users/minghaizhao/WebstormProjects/databright/node_modules/electron-builder/src/packager.ts:252:22
    at next (native)
    at /Users/minghaizhao/WebstormProjects/databright/node_modules/fs-extra-p/node_modules/fs-extra/lib/mkdirs/mkdirs.js:54:16
    at /Users/minghaizhao/WebstormProjects/databright/node_modules/fs-extra-p/node_modules/graceful-fs/polyfills.js:287:18
    at FSReqWrap.oncomplete (fs.js:123:15)
From previous event:
    at Packager.doBuild (/Users/minghaizhao/WebstormProjects/databright/node_modules/electron-builder/out/packager.js:371:11)
    at /Users/minghaizhao/WebstormProjects/databright/node_modules/electron-builder/src/packager.ts:163:38
    at next (native)
    at runCallback (timers.js:651:20)
    at tryOnImmediate (timers.js:624:5)
    at processImmediate [as _immediateCallback] (timers.js:596:5)
From previous event:
    at Packager.build (/Users/minghaizhao/WebstormProjects/databright/node_modules/electron-builder/out/packager.js:263:11)
    at /Users/minghaizhao/WebstormProjects/databright/node_modules/electron-builder/src/builder.ts:217:33
    at next (native)
From previous event:
    at build (/Users/minghaizhao/WebstormProjects/databright/node_modules/electron-builder/out/builder.js:70:21)
    at Object.<anonymous> (/Users/minghaizhao/WebstormProjects/databright/node_modules/electron-builder/out/cli/build-cli.js:71:41)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.runMain (module.js:604:10)
    at run (bootstrap_node.js:394:7)
    at startup (bootstrap_node.js:149:9)
    at bootstrap_node.js:509:3



Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
bright-seacommented, Mar 31, 2017

@blahah Thanks for your suggestion of nightmare. That’s really helpful!

0reactions
blahahcommented, Mar 26, 2017

@bright-sea Generally phantomjs as a node dependency is downloaded as a precompiled binary that might be pre-signed. Probably to re-sign it you would need to compile from scratch.

However, I would strongly recommend not using phantomjs - you’ll add a lot of size to your final distributable files. A great alternative for a lot of use cases is to use nightmare [website : github], which does similar stuff to phantom except it uses electron as the engine, so you can reuse the electron binaries that are already in your app.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to codesign my *.app (error… | Apple Developer Forums
Log in to the GUI of the Mac that has the Apple Development: Amritpal Singh (…) identity in its keychain. In Terminal, run...
Read more >
Mac Codesign Utility Signing Code in Mac OS - DigiCert.com
Apple code signing is done from the command line using their (aptly named) codesign tool and should be very straightforward. Note: You can...
Read more >
How to Fix iOS Application Code Signing Error? - Medium
Common Solution 1: Check Valid Certificate​​ You should check the keychain to the valid certificate is added correctly. You can do it via...
Read more >
How to sign scripts and other custom code - MacBlog
First, it certifies authenticity. Signed code provides macOS (and your users) a mechanism to verify that a program was created by a specific ......
Read more >
Codesign Digital Signatures in Mac OS - Knowledge Base
Code Signing for Apple is done from the command line using their (aptly named) codesign tool, and should be very straightforward. Make sure...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found