hashlib icon indicating copy to clipboard operation
hashlib copied to clipboard

hashlib 1.0.1 not installing on OSX 10.7

Open EnriqueVidal opened this issue 14 years ago • 7 comments

I was able to install hashlib on Snow Leopard but in Lion this is the output I see:

> [email protected] preinstall /Users/enrique/Desktop/hubot/node_modules/hashlib
> node-waf clean || true; node-waf configure build

Nothing to clean (project not configured)
Checking for program g++ or c++          : /usr/bin/g++ 
Checking for program cpp                 : /usr/bin/cpp 
Checking for program ar                  : /usr/bin/ar 
Checking for program ranlib              : /usr/bin/ranlib 
Checking for g++                         : ok  
Checking for program gcc or cc           : /usr/bin/gcc 
Checking for gcc                         : ok  
Checking for node path                   : not found 
Checking for node prefix                 : ok /opt/local 
'configure' finished successfully (0.126s)
Waf: Entering directory `/Users/enrique/Desktop/hubot/node_modules/hashlib/build'
[1/6] cc: libhash/md4c.c -> build/Release/libhash/md4c_1.o
[2/6] cc: libhash/md5c.c -> build/Release/libhash/md5c_1.o
[3/6] cc: libhash/sha0c.c -> build/Release/libhash/sha0c_1.o
[4/6] cxx: hashlib.cc -> build/Release/hashlib_2.o
../hashlib.cc:14:16: error: ev.h: No such file or directory
../hashlib.cc:15:17: error: eio.h: No such file or directory
../hashlib.cc:311: error: ‘eio_req’ was not declared in this scope
../hashlib.cc:311: error: ‘req’ was not declared in this scope
../hashlib.cc:312: error: expected ‘,’ or ‘;’ before ‘{’ token
Waf: Leaving directory `/Users/enrique/Desktop/hubot/node_modules/hashlib/build'
Build failed:  -> task failed (err #1): 
    {task: cxx hashlib.cc -> hashlib_2.o}
npm ERR! error installing [email protected] Error: [email protected] preinstall: `node-waf clean || true; node-waf configure build`
npm ERR! error installing [email protected] `sh "-c" "node-waf clean || true; node-waf configure build"` failed with 1
npm ERR! error installing [email protected]     at ChildProcess.<anonymous> (/opt/local/lib/node_modules/npm/lib/utils/exec.js:49:20)
npm ERR! error installing [email protected]     at ChildProcess.emit (events.js:70:17)
npm ERR! error installing [email protected]     at maybeExit (child_process.js:359:16)
npm ERR! error installing [email protected]     at Process.onexit (child_process.js:395:5)
npm ERR! [email protected] preinstall: `node-waf clean || true; node-waf configure build`
npm ERR! `sh "-c" "node-waf clean || true; node-waf configure build"` failed with 1
npm ERR! 
npm ERR! Failed at the [email protected] preinstall script.
npm ERR! This is most likely a problem with the hashlib package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-waf clean || true; node-waf configure build
npm ERR! You can get their info via:
npm ERR!     npm owner ls hashlib
npm ERR! There is likely additional logging output above.
npm ERR! 
npm ERR! System Darwin 11.2.0
npm ERR! command "node" "/opt/local/bin/npm" "install"
npm ERR! cwd /Users/enrique/Desktop/hubot
npm ERR! node -v v0.6.5
npm ERR! npm -v 1.0.106
npm ERR! code ELIFECYCLE
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /Users/enrique/Desktop/hubot/npm-debug.log
npm not ok

EnriqueVidal avatar Dec 15 '11 15:12 EnriqueVidal

I did notice Checking for node path: not found but node is installed and no other npm package complains. Please advise.

EnriqueVidal avatar Dec 15 '11 15:12 EnriqueVidal

quickfix: sudo ln -sf /usr/local/include/node/node.h /usr/local/include/node/ev.h CXXFLAGS=-I/usr/local/include/node/uv-private/ npm install hashlib

It compiles, but when i require('hashlib') i get cannot find module 'hashlib' - so there is something missing.

BadKnees avatar Dec 19 '11 04:12 BadKnees

ahh, full path:

var hashlib = require('./node_modules/hashlib/build/Release/hashlib');

Now it works

BadKnees avatar Dec 19 '11 05:12 BadKnees

Where do I set that variable?

EnriqueVidal avatar Dec 19 '11 15:12 EnriqueVidal

Which variable? If you mean the first post you can paste those two lines in you terminal. The first one will make a link from node to ev.h as ev.h is now gone and everything is in node.h. And the second sets an environmen variable for npm so the compiler can find the other sources.

If you mean the second post, it's in your project. e.g app.js or something

BadKnees avatar Dec 21 '11 04:12 BadKnees

Remember to do the same with eio.h:

# sudo ln -sf /usr/local/include/node/node.h /usr/local/include/node/eio.h

and copy it to the root file:

# cp ./build/Release/hashlib.node ~/.node_libraries/hashlib.node

rogersm avatar Jan 15 '12 19:01 rogersm

You can drop the long path if you go into the package.json file and swap "Release" in place of "Default" in the main and directories entries.

  "main": "build/Release/hashlib",
  "directories": {
    "lib": "./build/Release"
  },

ssokol1971 avatar Apr 23 '12 22:04 ssokol1971