nodegit: nodegit in alpine docker image fails with __rawmemchr: symbol not found

~ $ node -v
v5.10.1
~ $ npm -v
3.8.3

npm install nodegit;npm ls

> nodegit@0.13.0 install /home/user/node_modules/nodegit
> node lifecycleScripts/install

[nodegit] Fetching binary from S3.
[nodegit] Completed installation successfully.

> nodegit@0.13.0 postinstall /home/user/node_modules/nodegit

/home/user
`-- nodegit@0.13.0 
  +-- fs-extra@0.26.7 
  | +-- graceful-fs@4.1.4 
  | +-- jsonfile@2.3.1 
  | +-- klaw@1.2.0 
  | +-- path-is-absolute@1.0.0 
  | `-- rimraf@2.5.2 
  |   `-- glob@7.0.3 
  |     +-- inflight@1.0.5 
  |     | `-- wrappy@1.0.2 
  |     +-- inherits@2.0.1 
  |     +-- minimatch@3.0.0 
  |     | `-- brace-expansion@1.1.4 
  |     |   +-- balanced-match@0.4.1 
  |     |   `-- concat-map@0.0.1 
  |     `-- once@1.3.3 
  +-- node-pre-gyp@0.6.27 
  | +-- mkdirp@0.5.1 
  | | `-- minimist@0.0.8 
  | +-- nopt@3.0.6 
  | | `-- abbrev@1.0.7 
  | +-- npmlog@2.0.3 
  | | +-- ansi@0.3.1 
  | | +-- are-we-there-yet@1.1.2 
  | | | +-- delegates@1.0.0 
  | | | `-- readable-stream@2.1.2 
  | | `-- gauge@1.2.7 
  | |   +-- has-unicode@2.0.0 
  | |   +-- lodash.pad@4.3.0 
  | |   | +-- lodash._baseslice@4.0.0 
  | |   | `-- lodash.tostring@4.1.2 
  | |   +-- lodash.padend@4.4.0 
  | |   `-- lodash.padstart@4.4.0 
  | +-- rc@1.1.6 
  | | +-- deep-extend@0.4.1 
  | | +-- ini@1.3.4 
  | | +-- minimist@1.2.0 
  | | `-- strip-json-comments@1.0.4 
  | +-- request@2.72.0 
  | | +-- aws-sign2@0.6.0 
  | | +-- aws4@1.3.2 
  | | | `-- lru-cache@4.0.1 
  | | |   +-- pseudomap@1.0.2 
  | | |   `-- yallist@2.0.0 
  | | +-- bl@1.1.2 
  | | | `-- readable-stream@2.0.6 
  | | +-- caseless@0.11.0 
  | | +-- combined-stream@1.0.5 
  | | | `-- delayed-stream@1.0.0 
  | | +-- extend@3.0.0 
  | | +-- forever-agent@0.6.1 
  | | +-- form-data@1.0.0-rc4 
  | | | `-- async@1.5.2 
  | | +-- har-validator@2.0.6 
  | | | +-- chalk@1.1.3 
  | | | | +-- ansi-styles@2.2.1 
  | | | | +-- escape-string-regexp@1.0.5 
  | | | | +-- has-ansi@2.0.0 
  | | | | | `-- ansi-regex@2.0.0 
  | | | | +-- strip-ansi@3.0.1 
  | | | | `-- supports-color@2.0.0 
  | | | +-- commander@2.9.0 
  | | | | `-- graceful-readlink@1.0.1 
  | | | +-- is-my-json-valid@2.13.1 
  | | | | +-- generate-function@2.0.0 
  | | | | +-- generate-object-property@1.2.0 
  | | | | | `-- is-property@1.0.2 
  | | | | +-- jsonpointer@2.0.0 
  | | | | `-- xtend@4.0.1 
  | | | `-- pinkie-promise@2.0.1 
  | | |   `-- pinkie@2.0.4 
  | | +-- hawk@3.1.3 
  | | | +-- boom@2.10.1 
  | | | +-- cryptiles@2.0.5 
  | | | +-- hoek@2.16.3 
  | | | `-- sntp@1.0.9 
  | | +-- http-signature@1.1.1 
  | | | +-- assert-plus@0.2.0 
  | | | +-- jsprim@1.2.2 
  | | | | +-- extsprintf@1.0.2 
  | | | | +-- json-schema@0.2.2 
  | | | | `-- verror@1.3.6 
  | | | `-- sshpk@1.8.3 
  | | |   +-- asn1@0.2.3 
  | | |   +-- assert-plus@1.0.0 
  | | |   +-- dashdash@1.13.1 
  | | |   | `-- assert-plus@1.0.0 
  | | |   +-- ecc-jsbn@0.1.1 
  | | |   +-- getpass@0.1.6 
  | | |   | `-- assert-plus@1.0.0 
  | | |   +-- jodid25519@1.0.2 
  | | |   +-- jsbn@0.1.0 
  | | |   `-- tweetnacl@0.13.3 
  | | +-- is-typedarray@1.0.0 
  | | +-- isstream@0.1.2 
  | | +-- json-stringify-safe@5.0.1 
  | | +-- mime-types@2.1.11 
  | | | `-- mime-db@1.23.0 
  | | +-- node-uuid@1.4.7 
  | | +-- oauth-sign@0.8.2 
  | | +-- qs@6.1.0 
  | | +-- stringstream@0.0.5 
  | | +-- tough-cookie@2.2.2 
  | | `-- tunnel-agent@0.4.3 
  | +-- rimraf@2.5.2 
  | | `-- glob@7.0.3 
  | |   +-- inflight@1.0.4 
  | |   +-- minimatch@3.0.0 
  | |   | `-- brace-expansion@1.1.4 
  | |   |   +-- balanced-match@0.4.1 
  | |   |   `-- concat-map@0.0.1 
  | |   `-- path-is-absolute@1.0.0 
  | +-- semver@5.1.0 
  | +-- tar@2.2.1 
  | | +-- block-stream@0.0.9 
  | | +-- fstream@1.0.8 
  | | | `-- graceful-fs@4.1.3 
  | | `-- inherits@2.0.1 
  | `-- tar-pack@3.1.3 
  |   +-- debug@2.2.0 
  |   | `-- ms@0.7.1 
  |   +-- fstream-ignore@1.0.4 
  |   +-- once@1.3.3 
  |   | `-- wrappy@1.0.1 
  |   +-- readable-stream@2.0.6 
  |   | +-- core-util-is@1.0.2 
  |   | +-- isarray@1.0.0 
  |   | +-- process-nextick-args@1.0.7 
  |   | +-- string_decoder@0.10.31 
  |   | `-- util-deprecate@1.0.2 
  |   `-- uid-number@0.0.6 
  `-- promisify-node@0.3.0 
    `-- nodegit-promise@4.0.0 
      `-- asap@2.0.4 
~ $ node
> require('nodegit')
Error: Error relocating /home/bdb/node_modules/nodegit/build/Release/nodegit.node: __rawmemchr: symbol not found
    at Error (native)
    at Object.Module._extensions..node (module.js:440:18)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at Module.require (module.js:367:17)
    at require (internal/module.js:16:19)
    at Object.<anonymous> (/home/bdb/node_modules/nodegit/dist/nodegit.js:11:12)
    at Module._compile (module.js:413:34)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)

About this issue

  • Original URL
  • State: open
  • Created 8 years ago
  • Comments: 24 (2 by maintainers)

Most upvoted comments

At Cucumber Ltd, we run NodeGit in a docker container. Our base image is alpine-node (node 6.1.0, but node 5.11.x works as well). The pre-built binary is not working because of musl libc limitations indeed. So we use the following command to install node packages:

$ BUILD_ONLY=true npm install

This according to the guide will force a build instead of relying on fetched binaries. With the current version of nodegit (0.13.0), a bug in the install scripts prevents us from building the binary via npm. It has been fixed here: d8dcc0f8fdcd0c8f662dddbb6cae59cea267b34b, thanks @johnhaley81! For now we are stuck on version 0.12.2.

Is it possible to release a new version of nodegit that includes this change soon, so we could test nodegit 0.13.x in that environment?