Nodegit: After upgrade to El Capitan 10.11.1 can't find gcrypt error through npm install

Created on 27 Nov 2015  路  7Comments  路  Source: nodegit/nodegit

I just upgraded to El Capitan version 10.11.1 (15B42) from Mavericks. I cleaned out all my node_modules and installed again, but nodegit isn't installing. It skips the prebuild binary and tries to build.

For reason it can't find gcrypt.h. Any help you can give?

:99:1: note: expanded from here
kh_clear_str
^
../vendor/libgit2/src/transaction.c:21:1: warning: unused function 'kh_del_str' [-Wunused-function]
../vendor/libgit2/src/strmap.h:24: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:344:13: note: expanded from macro '__KHASH_IMPL'
SCOPE void kh_del_##name(kh_##name##_t *h, khint_t x) \
^
:113:1: note: expanded from here
kh_del_str
^
2 warnings generated.
In file included from ../vendor/libssh2/src/agent.c:40:
In file included from ../vendor/libssh2/src/libssh2_priv.h:132:
In file included from ../vendor/libssh2/src/crypto.h:42:
../vendor/libssh2/src/libgcrypt.h:40:10: fatal error: 'gcrypt.h' file not found

include

     ^

1 error generated.
make: *** [Release/obj.target/libssh2/vendor/libssh2/src/agent.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/Users/adam/src/numetric-web/node_modules/nodegit/node_modules/node-gyp/lib/build.js:276: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 (internal/child_process.js:200:12)
gyp ERR! System Darwin 15.0.0
gyp ERR! command "/usr/local/Cellar/node/5.1.0/bin/node" "/Users/adam/src/numetric-web/node_modules/nodegit/node_modules/.bin/node-gyp" "rebuild"
gyp ERR! cwd /Users/adam/src/numetric-web/node_modules/nodegit
gyp ERR! node -v v5.1.0
gyp ERR! node-gyp -v v3.2.0
gyp ERR! not ok
]
killed: false,
code: 1,
signal: null,
cmd: '/bin/sh -c /Users/adam/src/numetric-web/node_modules/nodegit/node_modules/.bin/node-gyp rebuild' }
undefined

Most helpful comment

Thanks. I was also able to fix the problem by doing export C_INCLUDE_PATH=/usr/local/include. Not sure if that is a correct solution though.

All 7 comments

This needs to be added to the docs. You have to force-link open-ssl. Usually easiest through homebrew, since apple stopped bundling true openssl as of el capitan.

brew install openssl
brew link openssl --force

Thanks. I was also able to fix the problem by doing export C_INCLUDE_PATH=/usr/local/include. Not sure if that is a correct solution though.

orly? That's interesting, may have to dig into that a bit. Thanks for letting us know about that!

brew link openssl --force

yields

Warning: Refusing to link: openssl
Linking keg-only openssl means you may end up linking against the insecure,
deprecated system OpenSSL while using the headers from Homebrew's openssl.
Instead, pass the full include/library paths to your compiler e.g.:
  -I/usr/local/opt/openssl/include -L/usr/local/opt/openssl/lib

Any other ideas?

I'm getting a similar issue on macOS Sierra version 10.12.2

```CC(target) Release/obj.target/libssh2/vendor/libssh2/src/agent.o
In file included from ../vendor/libssh2/src/agent.c:40:
In file included from ../vendor/libssh2/src/libssh2_priv.h:140:
In file included from ../vendor/libssh2/src/crypto.h:46:
../vendor/libssh2/src/libgcrypt.h:40:10: fatal error: 'gcrypt.h' file not found

include

     ^

1 error generated.
make: * [Release/obj.target/libssh2/vendor/libssh2/src/agent.o] Error 1

gyp

ERR! build error

gyp
ERR! stack Error: make failed with exit code: 2
gyp
ERR! stack at ChildProcess.onExit (/Users/Nick/projects/code-review-starter/node_modules/node-gyp/lib/build.js:276:23)
gyp
ERR! stack at emitTwo (events.js:106:13)
gyp ERR! stack at ChildProcess.emit (events.js:191:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
gyp
ERR! System Darwin 16.3.0
gyp
ERR! command "/usr/local/Cellar/node/7.4.0/bin/node" "/Users/Nick/projects/code-review-starter/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/Users/Nick/projects/code-review-starter/node_modules/nodegit/build/Release/nodegit.node" "--module_name=nodegit" "--module_path=/Users/Nick/projects/code-review-starter/node_modules/nodegit/build/Release"
gyp
ERR!
cwd /Users/Nick/projects/code-review-starter/node_modules/nodegit
gyp
ERR!
node -v v7.4.0
gyp
ERR!
node-gyp -v v3.5.0
gyp
ERR! not ok
node-pre-gyp
ERR! build error
node-pre-gyp
ERR! stack Error: Failed to execute '/usr/local/Cellar/node/7.4.0/bin/node /Users/Nick/projects/code-review-starter/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/Users/Nick/projects/code-review-starter/node_modules/nodegit/build/Release/nodegit.node --module_name=nodegit --module_path=/Users/Nick/projects/code-review-starter/node_modules/nodegit/build/Release' (1)
node-pre-gyp
ERR! stack at ChildProcess. (/Users/Nick/projects/code-review-starter/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR!
stack
at emitTwo (events.js:106:13)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:191:7)
node-pre-gyp ERR!
stack at maybeClose (internal/child_process.js:885:16)
node-pre-gyp
ERR!
stack at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
node-pre-gyp
ERR! System Darwin 16.3.0
node-pre-gyp
ERR!
command "/usr/local/Cellar/node/7.4.0/bin/node" "/Users/Nick/projects/code-review-starter/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd
/Users/Nick/projects/code-review-starter/node_modules/nodegit
node-pre-gyp ERR!
node -v v7.4.0
node-pre-gyp
ERR! node-pre-gyp -v v0.6.32
node-pre-gyp
ERR! not ok
Failed to execute '/usr/local/Cellar/node/7.4.0/bin/node /Users/Nick/projects/code-review-starter/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/Users/Nick/projects/code-review-starter/node_modules/nodegit/build/Release/nodegit.node --module_name=nodegit --module_path=/Users/Nick/projects/code-review-starter/node_modules/nodegit/build/Release' (1)
[nodegit] ERROR - Could not finish install
[nodegit] ERROR - finished with error code: 1
npm WARN [email protected] requires a peer of eslint@>=3.12.1 but none was installed.
npm WARN [email protected] requires a peer of eslint-plugin-react@>=6.8.0 but none was installed.
npm WARN [email protected] No repository field.
npm ERR! Darwin 16.3.0
npm ERR! argv "/usr/local/Cellar/node/7.4.0/bin/node" "/usr/local/bin/npm" "install" "nodegit"
npm ERR! node v7.4.0
npm ERR! npm v4.0.5
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: node lifecycleScripts/preinstall && node lifecycleScripts/install
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node lifecycleScripts/preinstall && node lifecycleScripts/install'.
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 nodegit package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node lifecycleScripts/preinstall && node lifecycleScripts/install
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs nodegit
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls nodegit
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /Users/Nick/projects/code-review-starter/npm-debug.log
```

I did brew install openssl and tried to create the symlink

brew install openssl
brew link openssl --force

but it errored out when creating the link

brew link openssl --force

Warning: Refusing to link: openssl
Linking keg-only openssl means you may end up linking against the insecure,
deprecated system OpenSSL while using the headers from Homebrew's openssl.
Instead, pass the full include/library paths to your compiler e.g.:
-I/usr/local/opt/openssl/include -L/usr/local/opt/openssl/lib

Other system info:
Homebrew 1.1.9
Homebrew/homebrew-core (git revision 21316; last commit 2017-01-30)
Openssl-1.0.2

Can you try export C_INCLUDE_PATH=/usr/local/include as monkeyboy64 posted? still install openssl via brew, but obviously not the force link

Having the same issue and the C_EXPORT_PATH still doesn't solve the problem :/

Was this page helpful?
0 / 5 - 0 ratings

Related issues

feifeipan picture feifeipan  路  5Comments

seokju-na picture seokju-na  路  4Comments

xiemms picture xiemms  路  5Comments

Sergeeeek picture Sergeeeek  路  9Comments

petemill picture petemill  路  3Comments