flow-typed: `npm install -g flow-typed` fails on node v4.4.0 and npm 2.x

Created a new issue from the comment on #4.

Running on OS X El Capitan, npm version 2.15.2 and node v4.4.0, I get this:

$ npm install flow-typed -g
-
> nodegit@0.13.2 install /Users/vesa/.nvm/versions/node/v4.4.0/lib/node_modules/flow-typed/node_modules/nodegit
> node lifecycleScripts/install

[nodegit] Fetching binary from S3.
[nodegit] Failed to install prebuilt binary:
{ [Error: Command failed: /bin/sh -c "/Users/vesa/.nvm/versions/node/v4.4.0/lib/node_modules/flow-typed/node_modules/nodegit/node_modules/.bin/node-pre-gyp" install --fallback-to-build=false
module.js:327
    throw err;
    ^

Error: Cannot find module 'nopt'
    at Function.Module._resolveFilename (module.js:325:15)
    at Function.Module._load (module.js:276:25)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (/Users/vesa/.nvm/versions/node/v4.4.0/lib/node_modules/flow-typed/node_modules/nodegit/node_modules/node-pre-gyp/lib/node-pre-gyp.js:14:12)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)
]
  killed: false,
  code: 1,
  signal: null,
  cmd: '/bin/sh -c "/Users/vesa/.nvm/versions/node/v4.4.0/lib/node_modules/flow-typed/node_modules/nodegit/node_modules/.bin/node-pre-gyp" install --fallback-to-build=false' }
[nodegit] Building manually. (You'll be here a while.)
[nodegit] Regenerating and configuring code
nodegit@0.13.2 /Users/vesa/.nvm/versions/node/v4.4.0/lib/node_modules/nodegit
├── promisify-node@0.3.0 (nodegit-promise@4.0.0)
└── fs-extra@0.26.7 (path-is-absolute@1.0.0, klaw@1.3.0, graceful-fs@4.1.4, jsonfile@2.3.1, rimraf@2.5.2)

[nodegit] Configuring libssh2.
ERROR - Could not generate native code
[TypeError: _(...).forEach(...).value is not a function]
[nodegit] Everything is ready to go, attempting compilation
events.js:141
      throw er; // Unhandled 'error' event
      ^

Error: spawn /Users/vesa/.nvm/versions/node/v4.4.0/lib/node_modules/flow-typed/node_modules/nodegit/node_modules/.bin/node-gyp ENOENT
    at exports._errnoException (util.js:870:11)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:178:32)
    at onErrorNT (internal/child_process.js:344:16)
    at nextTickCallbackWith2Args (node.js:442:9)
    at process._tickCallback (node.js:356:17)
npm ERR! Darwin 15.5.0
npm ERR! argv "/Users/vesa/.nvm/versions/node/v4.4.0/bin/node" "/Users/vesa/.nvm/versions/node/v4.4.0/bin/npm" "install" "flow-typed" "-g"
npm ERR! node v4.4.0
npm ERR! npm  v2.15.2
npm ERR! code ELIFECYCLE

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 21 (20 by maintainers)

Commits related to this issue

Most upvoted comments

Hmm… so digging into this more, it is exactly the bundledDependencies that is the problem. I’m adding that fix to the PR and in my local tests it seems to indeed fix the issue you guys are having.

This is unfortunate 😕 Given that nodegit 0.13 was a big update (and was relatively recent), maybe it’s worth looking into switching back to v0.12.2 for a while while they get the kinks worked out.

I’ll look into this this week.

I can confirm that I can now install flow-typed after #162 landed, hooray! However, I still seem to have a nasty issue where I’m not able to install any libdefs, but that’s another issue.

EDIT: If anyone wonders what that issue was, it was #173

Looks like nodegit is the problem… and they seem to have a fix with version 0.13.1: https://github.com/nodegit/nodegit/releases/tag/v0.13.1