3rd-Eden / node-hashring

hashring is a consistent hashing algorithm for Node.js that is compatible with libketama and python's hash_ring package
MIT License
350 stars 61 forks source link

Cannot install 3.1 - missing 'nan' #28

Closed niveus closed 9 years ago

niveus commented 9 years ago

I can't seem to install memcached (which requires hashring) on two different systems. I've tried installing nan globally but that doesn't seem to matter.

> hashring@3.1.0 install /Users/jasongabriele/Documents/involute/sucker/node_modules/memcached/node_modules/hashring
> node-gyp rebuild

module.js:340
    throw err;
          ^
Error: Cannot find module 'nan'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at [eval]:1:1
    at Object.<anonymous> ([eval]-wrapper:6:22)
    at Module._compile (module.js:456:26)
    at evalScript (node.js:559:25)
    at startup (node.js:80:7)
    at node.js:929:3
gyp: Call to 'node -e "require('nan')"' returned exit status 8. while trying to load binding.gyp
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:343:16)
gyp ERR! stack     at ChildProcess.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:820:12)
gyp ERR! System Darwin 14.0.0
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/jasongabriele/Documents/involute/sucker/node_modules/memcached/node_modules/hashring
gyp ERR! node -v v0.10.35
gyp ERR! node-gyp -v v1.0.2
gyp ERR! not ok 
npm ERR! Darwin 14.0.0
npm ERR! argv "node" "/usr/local/bin/npm" "install"
npm ERR! node v0.10.35
npm ERR! npm  v2.1.18
npm ERR! code ELIFECYCLE

npm ERR! hashring@3.1.0 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the hashring@3.1.0 install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the hashring package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls hashring
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/jasongabriele/Documents/involute/sucker/npm-debug.log

Here's the line from my package.json: "memcached": ">= 2.1". Let me know if you want me to post that debug.log - it's pretty long

3rd-Eden commented 9 years ago

I have no idea why it's failing because it's defined in the package.json as required: https://github.com/3rd-Eden/node-hashring/blob/master/package.json#L28 so this sounds more like an npm bug than something that is related to this library.

niveus commented 9 years ago

I tried upgrading to npm 2.3.0 and it seems to work now. I guess the solution is to upgrade then!

3rd-Eden commented 9 years ago

Awesome, I'm glad that you solved it.