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.

Doesn't work with Electron

See original GitHub issue

The installation instructions for Electron http://www.nodegit.org/guides/install/electron/ have us add to package.json:

  "engines": {
    "electron": "0.20.7"
  }

And run npm install, which in turn runs lifecycleScripts/install.js. However, that install script is still based off the old “atom-shell” and not Electron:

https://github.com/nodegit/nodegit/blob/master/lifecycleScripts/install.js#L29 https://github.com/nodegit/nodegit/blob/master/lifecycleScripts/install.js#L106-L107

… so when you run npm install nodegit with the package.json above it will build against the current Node version, not Electron. Unsurprisingly, Electron blows if you try to require nodegit in it.

I’ve tried working around this by taking the instructions from Electron’s docs (https://github.com/atom/electron/blob/master/docs/tutorial/using-native-node-modules.md) and patching lifecycleScripts/install.js accordingly, e.g.:

diff --git a/lifecycleScripts/install.js b/lifecycleScripts/install.js
index 65b8031..7550fe0 100644
--- a/lifecycleScripts/install.js
+++ b/lifecycleScripts/install.js
@@ -18,7 +18,7 @@ var local = path.join.bind(path, __dirname);
 return whichNativeNodish("..")
   .then(function(results) {
     nwVersion = results.nwVersion;
-    asVersion = results.asVersion;
+    asVersion = '0.26.0';
   })
   .then(function() {
     if (nwVersion) {
@@ -103,8 +103,7 @@ function build() {

     target = "--target=" + asVersion;

-    distUrl = "--dist-url=https://gh-contractor-zcbenz.s3." +
-      "amazonaws.com/atom-shell/dist";
+    distUrl = "--dist-url=https://atom.io/download/atom-shell";
   }
   else if (nwVersion) {
     builder = "nw-gyp";

However, the build fails:

$ node lifecycleScripts/install
[nodegit] Must build for atom-shell
[nodegit] Making sure dependencies are available and native code is generated
[nodegit] Everything is ready to go, attempting compilation
[nodegit] Building native node module.
{ [Error: Command failed: /bin/sh -c HOME=~/.atom-shell-gyp /Users/aadib/temp/nodegit/node_modules/.bin/pangyp rebuild --target=0.26.0  --dist-url=https://atom.io/download/atom-shell
gyp info it worked if it ends with ok
gyp info using pangyp@2.2.0
gyp info using node@2.0.2 | darwin | x64
gyp info spawn python
gyp info spawn args [ '/Users/aadib/temp/nodegit/node_modules/pangyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/aadib/temp/nodegit/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/aadib/temp/nodegit/node_modules/pangyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/aadib/.atom-shell-gyp/.node-gyp/0.26.0/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/Users/aadib/.atom-shell-gyp/.node-gyp/0.26.0',
gyp info spawn args   '-Druntime=iojs',
gyp info spawn args   '-Dmodule_root_dir=/Users/aadib/temp/nodegit',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.' ]
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
../vendor/libgit2/src/attr.c:10:1: warning: unused function 'kh_clear_str' [-Wunused-function]
GIT__USE_STRMAP;
^
../vendor/libgit2/src/strmap.h:23:2: note: expanded from macro 'GIT__USE_STRMAP'
        __KHASH_IMPL(str, static kh_inline, const char *, void *, 1, kh_str_hash_func, kh_str_hash_equal)
        ^
../vendor/libgit2/src/khash.h:206:13: note: expanded from macro '__KHASH_IMPL'
        SCOPE void kh_clear_##name(kh_##name##_t *h)                                            \
                   ^
<scratch space>:74:1: note: expanded from here
kh_clear_str
^
../vendor/libgit2/src/attr.c:10:1: warning: unused function 'kh_del_str' [-Wunused-function]
../vendor/libgit2/src/strmap.h:23:2: note: expanded from macro 'GIT__USE_STRMAP'
        __KHASH_IMPL(str, static kh_inline, const char *, void *, 1, kh_str_hash_func, kh_str_hash_equal)
        ^
../vendor/libgit2/src/khash.h:333:13: note: expanded from macro '__KHASH_IMPL'
        SCOPE void kh_del_##name(kh_##name##_t *h, khint_t x)                           \
                   ^
<scratch space>:88:1: note: expanded from here
kh_del_str
^
2 warnings generated.
../vendor/libgit2/src/attrcache.c:8:1: warning: unused function 'kh_clear_str' [-Wunused-function]
GIT__USE_STRMAP;
^
../vendor/libgit2/src/strmap.h:23:2: note: expanded from macro 'GIT__USE_STRMAP'
        __KHASH_IMPL(str, static kh_inline, const char *, void *, 1, kh_str_hash_func, kh_str_hash_equal)
        ^
../vendor/libgit2/src/khash.h:206:13: note: expanded from macro '__KHASH_IMPL'
        SCOPE void kh_clear_##name(kh_##name##_t *h)                                            \
                   ^
<scratch space>:74:1: note: expanded from here
kh_clear_str
^
../vendor/libgit2/src/attrcache.c:8:1: warning: unused function 'kh_del_str' [-Wunused-function]
../vendor/libgit2/src/strmap.h:23:2: note: expanded from macro 'GIT__USE_STRMAP'
        __KHASH_IMPL(str, static kh_inline, const char *, void *, 1, kh_str_hash_func, kh_str_hash_equal)
        ^
../vendor/libgit2/src/khash.h:333:13: note: expanded from macro '__KHASH_IMPL'
        SCOPE void kh_del_##name(kh_##name##_t *h, khint_t x)                           \
                   ^
<scratch space>:88:1: note: expanded from here
kh_del_str
^
2 warnings generated.
../vendor/libgit2/src/clone.c:479:20: warning: unused function 'repository_base' [-Wunused-function]
static const char *repository_base(git_repository *repo)
                   ^
1 warning generated.
../vendor/libgit2/src/config_file.c:24:1: warning: unused function 'kh_clear_str' [-Wunused-function]
GIT__USE_STRMAP;
^
../vendor/libgit2/src/strmap.h:23:2: note: expanded from macro 'GIT__USE_STRMAP'
        __KHASH_IMPL(str, static kh_inline, const char *, void *, 1, kh_str_hash_func, kh_str_hash_equal)
        ^
../vendor/libgit2/src/khash.h:206:13: note: expanded from macro '__KHASH_IMPL'
        SCOPE void kh_clear_##name(kh_##name##_t *h)                                            \
                   ^
<scratch space>:74:1: note: expanded from here
kh_clear_str
^
../vendor/libgit2/src/config_file.c:24:1: warning: unused function 'kh_del_str' [-Wunused-function]
../vendor/libgit2/src/strmap.h:23:2: note: expanded from macro 'GIT__USE_STRMAP'
        __KHASH_IMPL(str, static kh_inline, const char *, void *, 1, kh_str_hash_func, kh_str_hash_equal)
        ^
../vendor/libgit2/src/khash.h:333:13: note: expanded from macro '__KHASH_IMPL'
        SCOPE void kh_del_##name(kh_##name##_t *h, khint_t x)                           \
                   ^
<scratch space>:88:1: note: expanded from here
kh_del_str
^
2 warnings generated.
../vendor/libgit2/src/diff_driver.c:20:1: warning: unused function 'kh_clear_str' [-Wunused-function]
GIT__USE_STRMAP;
^
../vendor/libgit2/src/strmap.h:23:2: note: expanded from macro 'GIT__USE_STRMAP'
        __KHASH_IMPL(str, static kh_inline, const char *, void *, 1, kh_str_hash_func, kh_str_hash_equal)
        ^
../vendor/libgit2/src/khash.h:206:13: note: expanded from macro '__KHASH_IMPL'
        SCOPE void kh_clear_##name(kh_##name##_t *h)                                            \
                   ^
<scratch space>:74:1: note: expanded from here
kh_clear_str
^
../vendor/libgit2/src/diff_driver.c:20:1: warning: unused function 'kh_del_str' [-Wunused-function]
../vendor/libgit2/src/strmap.h:23:2: note: expanded from macro 'GIT__USE_STRMAP'
        __KHASH_IMPL(str, static kh_inline, const char *, void *, 1, kh_str_hash_func, kh_str_hash_equal)
        ^
../vendor/libgit2/src/khash.h:333:13: note: expanded from macro '__KHASH_IMPL'
        SCOPE void kh_del_##name(kh_##name##_t *h, khint_t x)                           \
                   ^
<scratch space>:88:1: note: expanded from here
kh_del_str
^
2 warnings generated.
../vendor/libgit2/src/mwindow.c:17:1: warning: unused function 'kh_clear_str' [-Wunused-function]
GIT__USE_STRMAP;
^
../vendor/libgit2/src/strmap.h:23:2: note: expanded from macro 'GIT__USE_STRMAP'
        __KHASH_IMPL(str, static kh_inline, const char *, void *, 1, kh_str_hash_func, kh_str_hash_equal)
        ^
../vendor/libgit2/src/khash.h:206:13: note: expanded from macro '__KHASH_IMPL'
        SCOPE void kh_clear_##name(kh_##name##_t *h)                                            \
                   ^
<scratch space>:121:1: note: expanded from here
kh_clear_str
^
1 warning generated.
../vendor/libgit2/src/odb_mempack.c:21:1: warning: unused function 'kh_destroy_oid' [-Wunused-function]
GIT__USE_OIDMAP;
^
../vendor/libgit2/src/oidmap.h:30:2: note: expanded from macro 'GIT__USE_OIDMAP'
        __KHASH_IMPL(oid, static kh_inline, const git_oid *, void *, 1, git_oidmap_hash, git_oid_equal)
        ^
../vendor/libgit2/src/khash.h:198:13: note: expanded from macro '__KHASH_IMPL'
        SCOPE void kh_destroy_##name(kh_##name##_t *h)                                          \
                   ^
<scratch space>:67:1: note: expanded from here
kh_destroy_oid
^
../vendor/libgit2/src/odb_mempack.c:21:1: warning: unused function 'kh_clear_oid' [-Wunused-function]
../vendor/libgit2/src/oidmap.h:30:2: note: expanded from macro 'GIT__USE_OIDMAP'
        __KHASH_IMPL(oid, static kh_inline, const git_oid *, void *, 1, git_oidmap_hash, git_oid_equal)
        ^
../vendor/libgit2/src/khash.h:206:13: note: expanded from macro '__KHASH_IMPL'
        SCOPE void kh_clear_##name(kh_##name##_t *h)                                            \
                   ^
<scratch space>:70:1: note: expanded from here
kh_clear_oid
^
../vendor/libgit2/src/odb_mempack.c:21:1: warning: unused function 'kh_del_oid' [-Wunused-function]
../vendor/libgit2/src/oidmap.h:30:2: note: expanded from macro 'GIT__USE_OIDMAP'
        __KHASH_IMPL(oid, static kh_inline, const git_oid *, void *, 1, git_oidmap_hash, git_oid_equal)
        ^
../vendor/libgit2/src/khash.h:333:13: note: expanded from macro '__KHASH_IMPL'
        SCOPE void kh_del_##name(kh_##name##_t *h, khint_t x)                           \
                   ^
<scratch space>:84:1: note: expanded from here
kh_del_oid
^
3 warnings generated.
../vendor/libgit2/src/refdb_fs.c:29:1: warning: unused function 'kh_init_str' [-Wunused-function]
GIT__USE_STRMAP;
^
../vendor/libgit2/src/strmap.h:23:2: note: expanded from macro 'GIT__USE_STRMAP'
        __KHASH_IMPL(str, static kh_inline, const char *, void *, 1, kh_str_hash_func, kh_str_hash_equal)
        ^
../vendor/libgit2/src/khash.h:195:23: note: expanded from macro '__KHASH_IMPL'
        SCOPE kh_##name##_t *kh_init_##name(void) {                                                     \
                             ^
<scratch space>:124:1: note: expanded from here
kh_init_str
^
../vendor/libgit2/src/refdb_fs.c:29:1: warning: unused function 'kh_destroy_str' [-Wunused-function]
../vendor/libgit2/src/strmap.h:23:2: note: expanded from macro 'GIT__USE_STRMAP'
        __KHASH_IMPL(str, static kh_inline, const char *, void *, 1, kh_str_hash_func, kh_str_hash_equal)
        ^
../vendor/libgit2/src/khash.h:198:13: note: expanded from macro '__KHASH_IMPL'
        SCOPE void kh_destroy_##name(kh_##name##_t *h)                                          \
                   ^
<scratch space>:129:1: note: expanded from here
kh_destroy_str
^
../vendor/libgit2/src/refdb_fs.c:29:1: warning: unused function 'kh_clear_str' [-Wunused-function]
../vendor/libgit2/src/strmap.h:23:2: note: expanded from macro 'GIT__USE_STRMAP'
        __KHASH_IMPL(str, static kh_inline, const char *, void *, 1, kh_str_hash_func, kh_str_hash_equal)
        ^
../vendor/libgit2/src/khash.h:206:13: note: expanded from macro '__KHASH_IMPL'
        SCOPE void kh_clear_##name(kh_##name##_t *h)                                            \
                   ^
<scratch space>:132:1: note: expanded from here
kh_clear_str
^
../vendor/libgit2/src/refdb_fs.c:29:1: warning: unused function 'kh_get_str' [-Wunused-function]
../vendor/libgit2/src/strmap.h:23:2: note: expanded from macro 'GIT__USE_STRMAP'
        __KHASH_IMPL(str, static kh_inline, const char *, void *, 1, kh_str_hash_func, kh_str_hash_equal)
        ^
../vendor/libgit2/src/khash.h:213:16: note: expanded from macro '__KHASH_IMPL'
        SCOPE khint_t kh_get_##name(const kh_##name##_t *h, khkey_t key)        \
                      ^
<scratch space>:135:1: note: expanded from here
kh_get_str
^
../vendor/libgit2/src/refdb_fs.c:29:1: warning: unused function 'kh_put_str' [-Wunused-function]
../vendor/libgit2/src/strmap.h:23:2: note: expanded from macro 'GIT__USE_STRMAP'
        __KHASH_IMPL(str, static kh_inline, const char *, void *, 1, kh_str_hash_func, kh_str_hash_equal)
        ^
../vendor/libgit2/src/khash.h:291:16: note: expanded from macro '__KHASH_IMPL'
        SCOPE khint_t kh_put_##name(kh_##name##_t *h, khkey_t key, int *ret) \
                      ^
<scratch space>:141:1: note: expanded from here
kh_put_str
^
../vendor/libgit2/src/refdb_fs.c:29:1: warning: unused function 'kh_del_str' [-Wunused-function]
../vendor/libgit2/src/strmap.h:23:2: note: expanded from macro 'GIT__USE_STRMAP'
        __KHASH_IMPL(str, static kh_inline, const char *, void *, 1, kh_str_hash_func, kh_str_hash_equal)
        ^
../vendor/libgit2/src/khash.h:333:13: note: expanded from macro '__KHASH_IMPL'
        SCOPE void kh_del_##name(kh_##name##_t *h, khint_t x)                           \
                   ^
<scratch space>:146:1: note: expanded from here
kh_del_str
^
6 warnings generated.
../vendor/libgit2/src/refs.c:27:1: warning: unused function 'kh_init_str' [-Wunused-function]
GIT__USE_STRMAP;
^
../vendor/libgit2/src/strmap.h:23:2: note: expanded from macro 'GIT__USE_STRMAP'
        __KHASH_IMPL(str, static kh_inline, const char *, void *, 1, kh_str_hash_func, kh_str_hash_equal)
        ^
../vendor/libgit2/src/khash.h:195:23: note: expanded from macro '__KHASH_IMPL'
        SCOPE kh_##name##_t *kh_init_##name(void) {                                                     \
                             ^
<scratch space>:124:1: note: expanded from here
kh_init_str
^
../vendor/libgit2/src/refs.c:27:1: warning: unused function 'kh_destroy_str' [-Wunused-function]
../vendor/libgit2/src/strmap.h:23:2: note: expanded from macro 'GIT__USE_STRMAP'
        __KHASH_IMPL(str, static kh_inline, const char *, void *, 1, kh_str_hash_func, kh_str_hash_equal)
        ^
../vendor/libgit2/src/khash.h:198:13: note: expanded from macro '__KHASH_IMPL'
        SCOPE void kh_destroy_##name(kh_##name##_t *h)                                          \
                   ^
<scratch space>:129:1: note: expanded from here
kh_destroy_str
^
../vendor/libgit2/src/refs.c:27:1: warning: unused function 'kh_clear_str' [-Wunused-function]
../vendor/libgit2/src/strmap.h:23:2: note: expanded from macro 'GIT__USE_STRMAP'
        __KHASH_IMPL(str, static kh_inline, const char *, void *, 1, kh_str_hash_func, kh_str_hash_equal)
        ^
../vendor/libgit2/src/khash.h:206:13: note: expanded from macro '__KHASH_IMPL'
        SCOPE void kh_clear_##name(kh_##name##_t *h)                                            \
                   ^
<scratch space>:132:1: note: expanded from here
kh_clear_str
^
../vendor/libgit2/src/refs.c:27:1: warning: unused function 'kh_get_str' [-Wunused-function]
../vendor/libgit2/src/strmap.h:23:2: note: expanded from macro 'GIT__USE_STRMAP'
        __KHASH_IMPL(str, static kh_inline, const char *, void *, 1, kh_str_hash_func, kh_str_hash_equal)
        ^
../vendor/libgit2/src/khash.h:213:16: note: expanded from macro '__KHASH_IMPL'
        SCOPE khint_t kh_get_##name(const kh_##name##_t *h, khkey_t key)        \
                      ^
<scratch space>:135:1: note: expanded from here
kh_get_str
^
../vendor/libgit2/src/refs.c:27:1: warning: unused function 'kh_put_str' [-Wunused-function]
../vendor/libgit2/src/strmap.h:23:2: note: expanded from macro 'GIT__USE_STRMAP'
        __KHASH_IMPL(str, static kh_inline, const char *, void *, 1, kh_str_hash_func, kh_str_hash_equal)
        ^
../vendor/libgit2/src/khash.h:291:16: note: expanded from macro '__KHASH_IMPL'
        SCOPE khint_t kh_put_##name(kh_##name##_t *h, khkey_t key, int *ret) \
                      ^
<scratch space>:141:1: note: expanded from here
kh_put_str
^
../vendor/libgit2/src/refs.c:27:1: warning: unused function 'kh_del_str' [-Wunused-function]
../vendor/libgit2/src/strmap.h:23:2: note: expanded from macro 'GIT__USE_STRMAP'
        __KHASH_IMPL(str, static kh_inline, const char *, void *, 1, kh_str_hash_func, kh_str_hash_equal)
        ^
../vendor/libgit2/src/khash.h:333:13: note: expanded from macro '__KHASH_IMPL'
        SCOPE void kh_del_##name(kh_##name##_t *h, khint_t x)                           \
                   ^
<scratch space>:146:1: note: expanded from here
kh_del_str
^
6 warnings generated.
../vendor/libgit2/src/submodule.c:86:1: warning: unused function 'kh_clear_str' [-Wunused-function]
__KHASH_IMPL(
^
../vendor/libgit2/src/khash.h:206:13: note: expanded from macro '__KHASH_IMPL'
        SCOPE void kh_clear_##name(kh_##name##_t *h)                                            \
                   ^
<scratch space>:74:1: note: expanded from here
kh_clear_str
^
1 warning generated.
../vendor/libgit2/src/transaction.c:20:1: warning: unused function 'kh_clear_str' [-Wunused-function]
GIT__USE_STRMAP;
^
../vendor/libgit2/src/strmap.h:23:2: note: expanded from macro 'GIT__USE_STRMAP'
        __KHASH_IMPL(str, static kh_inline, const char *, void *, 1, kh_str_hash_func, kh_str_hash_equal)
        ^
../vendor/libgit2/src/khash.h:206:13: note: expanded from macro '__KHASH_IMPL'
        SCOPE void kh_clear_##name(kh_##name##_t *h)                                            \
                   ^
<scratch space>:74:1: note: expanded from here
kh_clear_str
^
../vendor/libgit2/src/transaction.c:20:1: warning: unused function 'kh_del_str' [-Wunused-function]
../vendor/libgit2/src/strmap.h:23:2: note: expanded from macro 'GIT__USE_STRMAP'
        __KHASH_IMPL(str, static kh_inline, const char *, void *, 1, kh_str_hash_func, kh_str_hash_equal)
        ^
../vendor/libgit2/src/khash.h:333:13: note: expanded from macro '__KHASH_IMPL'
        SCOPE void kh_del_##name(kh_##name##_t *h, khint_t x)                           \
                   ^
<scratch space>:88:1: note: expanded from here
kh_del_str
^
2 warnings generated.
../vendor/libssh2/src/misc.c:214:19: warning: unused variable 'base64_table' [-Wunused-const-variable]
static const char base64_table[] =
                  ^
../vendor/libssh2/src/misc.c:223:19: warning: unused variable 'base64_pad' [-Wunused-const-variable]
static const char base64_pad = '=';
                  ^
2 warnings generated.
../vendor/openssl/openssl/ssl/d1_srtp.c:147:7: warning: missing field 'id' initializer [-Wmissing-field-initializers]
    {0}
      ^
1 warning generated.
../vendor/openssl/openssl/crypto/asn1/x_bignum.c:85:1: warning: missing field 'prim_print' initializer [-Wmissing-field-initializers]
};
^
1 warning generated.
../vendor/openssl/openssl/crypto/cmac/cm_ameth.c:96:2: warning: missing field 'item_verify' initializer [-Wmissing-field-initializers]
        };
        ^
1 warning generated.
../vendor/openssl/openssl/crypto/dh/dh_ameth.c:500:2: warning: missing field 'old_priv_decode' initializer [-Wmissing-field-initializers]
        };
        ^
1 warning generated.
../vendor/openssl/openssl/crypto/dsa/dsa_ameth.c:650:3: warning: missing field 'pem_str' initializer [-Wmissing-field-initializers]
                },
                ^
../vendor/openssl/openssl/crypto/dsa/dsa_ameth.c:656:3: warning: missing field 'pem_str' initializer [-Wmissing-field-initializers]
                },
                ^
../vendor/openssl/openssl/crypto/dsa/dsa_ameth.c:662:3: warning: missing field 'pem_str' initializer [-Wmissing-field-initializers]
                },
                ^
../vendor/openssl/openssl/crypto/dsa/dsa_ameth.c:668:3: warning: missing field 'pem_str' initializer [-Wmissing-field-initializers]
                },
                ^
../vendor/openssl/openssl/crypto/dsa/dsa_ameth.c:702:3: warning: missing field 'item_verify' initializer [-Wmissing-field-initializers]
                }
                ^
5 warnings generated.
../vendor/openssl/openssl/crypto/ec/ec_ameth.c:660:2: warning: missing field 'item_verify' initializer [-Wmissing-field-initializers]
        };
        ^
1 warning generated.
../vendor/openssl/openssl/crypto/ec/ec_lib.c:71:19: warning: unused variable 'EC_version' [-Wunused-const-variable]
static const char EC_version[] = "EC" OPENSSL_VERSION_PTEXT;
                  ^
1 warning generated.
../vendor/openssl/openssl/crypto/engine/eng_dyn.c:117:30: warning: unused variable 'dynamic_cmd_defns_empty' [-Wunused-const-variable]
static const ENGINE_CMD_DEFN dynamic_cmd_defns_empty[] = {
                             ^
1 warning generated.
../vendor/openssl/openssl/crypto/engine/eng_openssl.c:344:2: warning: missing field 'md_ctrl' initializer [-Wmissing-field-initializers]
        };
        ^
1 warning generated.
../vendor/openssl/openssl/crypto/evp/m_dss.c:94:2: warning: missing field 'md_ctrl' initializer [-Wmissing-field-initializers]
        };
        ^
1 warning generated.
../vendor/openssl/openssl/crypto/evp/m_dss1.c:96:2: warning: missing field 'md_ctrl' initializer [-Wmissing-field-initializers]
        };
        ^
1 warning generated.
../vendor/openssl/openssl/crypto/evp/m_ecdsa.c:144:2: warning: missing field 'md_ctrl' initializer [-Wmissing-field-initializers]
        };
        ^
1 warning generated.
../vendor/openssl/openssl/crypto/evp/m_md4.c:97:2: warning: missing field 'md_ctrl' initializer [-Wmissing-field-initializers]
        };
        ^
1 warning generated.
../vendor/openssl/openssl/crypto/evp/m_md5.c:96:2: warning: missing field 'md_ctrl' initializer [-Wmissing-field-initializers]
        };
        ^
1 warning generated.
../vendor/openssl/openssl/crypto/evp/m_mdc2.c:97:2: warning: missing field 'md_ctrl' initializer [-Wmissing-field-initializers]
        };
        ^
1 warning generated.
../vendor/openssl/openssl/crypto/evp/m_null.c:88:2: warning: missing field 'md_ctrl' initializer [-Wmissing-field-initializers]
        };
        ^
1 warning generated.
../vendor/openssl/openssl/crypto/evp/m_ripemd.c:96:2: warning: missing field 'md_ctrl' initializer [-Wmissing-field-initializers]
        };
        ^
1 warning generated.
../vendor/openssl/openssl/crypto/evp/m_sha.c:95:2: warning: missing field 'md_ctrl' initializer [-Wmissing-field-initializers]
        };
        ^
1 warning generated.
../vendor/openssl/openssl/crypto/evp/m_sha1.c:97:2: warning: missing field 'md_ctrl' initializer [-Wmissing-field-initializers]
        };
        ^
../vendor/openssl/openssl/crypto/evp/m_sha1.c:134:2: warning: missing field 'md_ctrl' initializer [-Wmissing-field-initializers]
        };
        ^
../vendor/openssl/openssl/crypto/evp/m_sha1.c:153:2: warning: missing field 'md_ctrl' initializer [-Wmissing-field-initializers]
        };
        ^
../vendor/openssl/openssl/crypto/evp/m_sha1.c:184:2: warning: missing field 'md_ctrl' initializer [-Wmissing-field-initializers]
        };
        ^
../vendor/openssl/openssl/crypto/evp/m_sha1.c:203:2: warning: missing field 'md_ctrl' initializer [-Wmissing-field-initializers]
        };
        ^
5 warnings generated.
../vendor/openssl/openssl/crypto/evp/m_wp.c:37:2: warning: missing field 'md_ctrl' initializer [-Wmissing-field-initializers]
        };
        ^
1 warning generated.
../vendor/openssl/openssl/crypto/hmac/hm_ameth.c:166:2: warning: missing field 'item_verify' initializer [-Wmissing-field-initializers]
        };
        ^
1 warning generated.
../vendor/openssl/openssl/crypto/pem/pem_lib.c:473:6: warning: variable 'i' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
        if (o)
            ^
../vendor/openssl/openssl/crypto/pem/pem_lib.c:480:5: note: uninitialized use occurs here
        j+=i;
           ^
../vendor/openssl/openssl/crypto/pem/pem_lib.c:473:2: note: remove the 'if' if its condition is always true
        if (o)
        ^~~~~~
../vendor/openssl/openssl/crypto/pem/pem_lib.c:443:7: note: initialize the variable 'i' to silence this warning
        int i,j,o,klen;
             ^
              = 0
1 warning generated.
../vendor/openssl/openssl/crypto/rsa/rsa_ameth.c:697:3: warning: missing field 'pem_str' initializer [-Wmissing-field-initializers]
                }
                ^
1 warning generated.
In file included from ../src/nodegit.cc:6:
In file included from ../src/../include/wrapper.h:11:
In file included from ../node_modules/nan/nan.h:80:
In file included from ../node_modules/nan/nan_new.h:190:
../node_modules/nan/nan_implementation_12_inl.h:181:66: error: too many arguments to function call, expected at most 2, have 4
  return v8::Signature::New(v8::Isolate::GetCurrent(), receiver, argc, argv);
         ~~~~~~~~~~~~~~~~~~                                      ^~~~~~~~~~
/Users/aadib/.atom-shell-gyp/.node-gyp/0.26.0/deps/v8/include/v8.h:4170:3: note: 'New' declared here
  static Local<Signature> New(
  ^
1 error generated.
make: *** [Release/obj.target/nodegit/src/nodegit.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/aadib/temp/nodegit/node_modules/pangyp/lib/build.js:271:23)
gyp ERR! stack     at emitTwo (events.js:87:13)
gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:1009:12)
gyp ERR! System Darwin 14.3.0
gyp ERR! command "/Users/aadib/.nvm/versions/io.js/v2.0.2/bin/iojs" "/Users/aadib/temp/nodegit/node_modules/.bin/pangyp" "rebuild" "--target=0.26.0" "--dist-url=https://atom.io/download/atom-shell"
gyp ERR! cwd /Users/aadib/temp/nodegit
gyp ERR! node -v v2.0.2
gyp ERR! pangyp -v v2.2.0
gyp ERR! not ok 
]
  killed: false,
  code: 1,
  signal: null,
  cmd: '/bin/sh -c HOME=~/.atom-shell-gyp /Users/aadib/temp/nodegit/node_modules/.bin/pangyp rebuild --target=0.26.0  --dist-url=https://atom.io/download/atom-shell' }
undefined

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
da1nerdcommented, Mar 1, 2016

Just for the sake of others looking at this. I ran around in circles trying to get nodegit working with electron on windows. It finally came down to a simple command.

Note: using electron 0.36.8, npm 3.6.0, node 5.7.0

cmd /C "set BUILD_ONLY=true && set ELECTRON_VERSION=0.36.8 && npm install nodegit"

where you’ll change the electron version to match whatever you are using.

Note: I did not have to change my “engine” in package.json to atom-shell.

Run that from within your project directory just like you were installing any other package. If there’s already a nodegit directory in your node_modules dir then you’ll have to delete it in order for the above command to work. It will take awhile to start and once it does you’ll see a wall of text as it begin compiling things.

There were pieces of the above command floating around but nothing was very clear.

Hope this helps someone!

0reactions
mjschockcommented, Dec 5, 2016

Thank you @neutrinog!

I spent the better part of a weekend searching for a solution for a similar issue with nodegit on macOS. The following finally resolved the issue:

BUILD_ONLY=true ELECTRON_VERSION=1.4.10 npm install nodegit -D

Here are my setup details:

  • macOS 10.12
  • Node.js 6.5.0
  • npm 3.10.3
  • Python 2.7.10
  • nodegit 0.16.0
  • electron 1.4.10
Read more comments on GitHub >

github_iconTop Results From Across the Web

electron quick start application not working - Stack Overflow
I have to run electron index.html to resolve this issue.
Read more >
Quick Start | Electron
"start": "electron ." This start command will let you open your app in development mode.
Read more >
Electron App Doesn't Launch After Packaging #3860 - GitHub
I will say, the script build-win32 works fine. But, it doesn't end up as a single exe so I can't use it. I...
Read more >
Common Configuration - electron-builder
electronDist String | module:app-builder-lib/out/configuration. ... Not supported on Linux, file issue if need (default icon will be x-office-document ).
Read more >
How to migrate an existing React Web App to ... - Rolique
There is a small issue with building the app. We specified a homepage as ./ which is correct for an Electron app. But...
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