nodegit: Failed at the nodegit@0.13.0 install script 'node lifecycleScripts/install'

  • Debian Jessie.

npm install nodegit fails with that error.

What I see is that in package.json there is:

"scripts": {
  "install": "node lifecycleScripts/install"
}

AFAIK this is wrong. Depending on the NPM version (and not sure what else) the install script is executed before moving the lib to its proper location under node_modules.

postinstall is the way to go.

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 7
  • Comments: 34 (4 by maintainers)

Most upvoted comments

EDIT:

Looks like for OSX I just needed to install libgcrypt via Homebrew and this was successful.


I feel I am running into a similar issue as others here. I’m on OSX 10.12.2. For the sake of trying, I did install libssh2 via Homebrew, but it hasn’t changed anything. Here’s my output:

$ sudo npm install nodegit -g --save

> nodegit@0.16.0 install /usr/local/lib/node_modules/nodegit
> node lifecycleScripts/preinstall && node lifecycleScripts/install

[nodegit] Running pre-install script
[nodegit] Configuring libssh2.
{ Error: Command failed: /usr/local/lib/node_modules/nodegit/vendor/libssh2/configure --with-libssl-prefix=/usr/local/lib/node_modules/nodegit/vendor/openssl/openssl
/usr/local/lib/node_modules/nodegit/vendor/libssh2/missing: Unknown `--is-lightweight' option
Try `/usr/local/lib/node_modules/nodegit/vendor/libssh2/missing --help' for more information
configure: WARNING: 'missing' script is too old or missing
configure: error: No crypto library found!
Try --with-libssl-prefix=PATH
 or --with-libgcrypt-prefix=PATH
 or --with-wincng on Windows

    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 Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
  killed: false,
  code: 1,
  signal: null,
  cmd: '/usr/local/lib/node_modules/nodegit/vendor/libssh2/configure --with-libssl-prefix=/usr/local/lib/node_modules/nodegit/vendor/openssl/openssl' }
/usr/local/lib/node_modules/nodegit/vendor/libssh2/missing: Unknown `--is-lightweight' option
Try `/usr/local/lib/node_modules/nodegit/vendor/libssh2/missing --help' for more information
configure: WARNING: 'missing' script is too old or missing
configure: error: No crypto library found!
Try --with-libssl-prefix=PATH
 or --with-libgcrypt-prefix=PATH
 or --with-wincng on Windows

[nodegit] ERROR - Could not finish preinstall
{ Error: Command failed: /usr/local/lib/node_modules/nodegit/vendor/libssh2/configure --with-libssl-prefix=/usr/local/lib/node_modules/nodegit/vendor/openssl/openssl
/usr/local/lib/node_modules/nodegit/vendor/libssh2/missing: Unknown `--is-lightweight' option
Try `/usr/local/lib/node_modules/nodegit/vendor/libssh2/missing --help' for more information
configure: WARNING: 'missing' script is too old or missing
configure: error: No crypto library found!
Try --with-libssl-prefix=PATH
 or --with-libgcrypt-prefix=PATH
 or --with-wincng on Windows

    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 Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
  killed: false,
  code: 1,
  signal: null,
  cmd: '/usr/local/lib/node_modules/nodegit/vendor/libssh2/configure --with-libssl-prefix=/usr/local/lib/node_modules/nodegit/vendor/openssl/openssl' }
npm ERR! Darwin 16.3.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "nodegit" "-g" "--save"
npm ERR! node v6.9.4
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE

npm ERR! nodegit@0.16.0 install: `node lifecycleScripts/preinstall && node lifecycleScripts/install`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the nodegit@0.16.0 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/tristanlee85/Documents/sustaining/npm-debug.log
tristanlee85@Tristans-MBP:sustaining$

Currently, nodegit requires you to have the openssl dev headers installed. On ubuntu: sudo apt-get install libssl-dev That should take care of it. If it doesn’t, let us know and we’ll reopen. related: https://github.com/nodegit/nodegit/issues/1093

Hello to everyone!, I’m having the same issue. Could you give me some suggestions?

OS: CentOS release 6.8 (Final) Node.js: v6.9.2 npm: v3.10.9

output:

npm WARN prefer global node-gyp@3.4.0 should be installed with -g

> nodegit@0.16.0 install /translations/node_modules/nodegit
> node lifecycleScripts/preinstall && node lifecycleScripts/install

[nodegit] Running pre-install script
[nodegit] Configuring libssh2.
{ Error: Command failed: /translations/node_modules/nodegit/vendor/libssh2/configure --with-libssl-prefix=/translations/node_modules/nodegit/vendor/openssl/openssl
/translations/node_modules/nodegit/vendor/libssh2/missing: Unknown `--is-lightweight' option
Try `/translations/node_modules/nodegit/vendor/libssh2/missing --help' for more information
configure: WARNING: 'missing' script is too old or missing
configure: error: in `/translations/node_modules/nodegit/vendor/libssh2':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details

    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)
  killed: false,
  code: 1,
  signal: null,
  cmd: '/translations/node_modules/nodegit/vendor/libssh2/configure --with-libssl-prefix=/translations/node_modules/nodegit/vendor/openssl/openssl' }
/translations/node_modules/nodegit/vendor/libssh2/missing: Unknown `--is-lightweight' option
Try `/translations/node_modules/nodegit/vendor/libssh2/missing --help' for more information
configure: WARNING: 'missing' script is too old or missing
configure: error: in `/translations/node_modules/nodegit/vendor/libssh2':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details

[nodegit] ERROR - Could not finish preinstall
{ Error: Command failed: /translations/node_modules/nodegit/vendor/libssh2/configure --with-libssl-prefix=/translations/node_modules/nodegit/vendor/openssl/openssl
/translations/node_modules/nodegit/vendor/libssh2/missing: Unknown `--is-lightweight' option
Try `/translations/node_modules/nodegit/vendor/libssh2/missing --help' for more information
configure: WARNING: 'missing' script is too old or missing
configure: error: in `/translations/node_modules/nodegit/vendor/libssh2':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details

    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)
  killed: false,
  code: 1,
  signal: null,
  cmd: '/translations/node_modules/nodegit/vendor/libssh2/configure --with-libssl-prefix=/translations/node_modules/nodegit/vendor/openssl/openssl' }
npm WARN translation-scripts@1.0.0 No repository field.
npm ERR! Linux 2.6.32-642.11.1.el6.x86_64
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "i" "nodegit"
npm ERR! node v6.9.2
npm ERR! npm  v3.10.9
npm ERR! code ELIFECYCLE

npm ERR! nodegit@0.16.0 install: `node lifecycleScripts/preinstall && node lifecycleScripts/install`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the nodegit@0.16.0 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!     /translations/npm-debug.log

Regards!

@maxkorp sudo apt-get install libssl-dev fixed this issue for me on Ubuntu

Yeah, your image will have to install libssl-dev (or openssl-devel on centos i think it’s called). See: #1093

@saper Done: #1103 Thanks for looking into this (although updating Node solved the issue for me).