Closed A closed 10 years ago
You'll have to up the verbosity on the output so we can see what the actual error is.
Here you are:
Sorry, but I've mistake in path to python. This is correct log:
My guess would be that you need to be using gmake instead of Sun's make to build node addons. Try installing gmake first then make sure that overrides Sun make. One easy, temporary way to override might be to try something like MAKE=gmake npm i xxhash --python=/usr/local/python/bin/python
.
export MAKE=gmake npm i xxhash --python=/usr/local/python/bin/python
And it's a log for this.
gmake -v
GNU Make 3.81
What C/C++ compiler do you have installed? What version?
gcc-4.7.2 but with non-GNU linker
You might try setting the LINK environment variable to a GNU linker and see if that helps any. Beyond that I don't know what else to suggest, this is an upstream node.js issue and I don't have/use SunOS myself. :-\
If setting LINK appropriately does not work, you should definitely file an issue on node's issue tracker.
Hi.
I'm actually Anton's system enginner (he's a programmer). I've managed to build the binary on both Solaris 10 and Solaris 11 (first doesn't have a GNU linker, and the second does). For this to succeed I edited some of the gyp/gmake files. Now I have a binary, and something tells me this isn't an executable (on Solaris 10 it coredumps when tried to execute, on Solaris 11 it says 'Bad entry point'). Plus, Solaris 11 node.js cannot find the module, so I'm pretty sure the hash.node binary is in some wrong place. Right now it's in the build/Release directory. Where does the node expect it to be ? I tried to look in the js files, but this is a rocket science to me.
Thanks.
It's supposed to be in build/Release
, that's where lib/xxhash.js
is expecting it to be.
So, from facts to conclusions and questions.
[root@hyperion xxhash]# node xxhash-test.js
module.js:340
throw err;
^
Error: Cannot find module 'xxhash'
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 Object.<anonymous> (/home/emz/xxhash/xxhash-test.js:1:76)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
Hash value = 529570172
The same result I get on Mac OS X, with a properly installed xxhash module (the only difference - Mc OS X's node doesn't complaint that the module is missing). So, it's clear that something is missing. Can you please help to pinpoint a problem ? Plus, does this result mean that the actual binary is used and, thus, that it's working ?
I have compared the file and directory layout from Mac OS X to Solaris, they both seem to be identical (at least I didn't find any differences inside the xxhash directory tree). Do I miss some symlink outside the xxhash directory ?
Thanks.
You can't do a require('xxhash');
from inside the xxhash module's root because require('xxhash')
looks for the 'node_modules' subdirectory and then a 'xxhash' subdirectory within that.
So if you do npm install xxhash
from your project/empty directory and then node xxhash-test.js
from the same directory, it should just work.
Got it.
Works as a charm with a locally installed module. For some reason doesn't work with a globally installed module, and this reason seems to be my own lack of node.js understanding.
Thanks a lot. You can close the issue.
P.S. Would be great if xxhash would use GNU install instead of a copy, which works differently on various platforms.
Right, you can't require globally installed modules without using npm link
to create a local symlink to the globally installed module. That behavior has been around in npm for some time now.
Regarding the use of GNU make, etc., that is an issue that is beyond the scope of this module so there's nothing I can really do about that. You may want to raise an issue on node's github issue tracker about it though. I do know that node used to (and may still) check for non-GNU make on BSD, but perhaps that same check doesn't work or isn't used on SunOS?
[books@atlas ~/underpage]$ npm i xxhash --python=/usr/local/python npm WARN package.json underpage@0.0.0 No repository field. npm WARN package.json underpage@0.0.0 No README data npm http GET https://registry.npmjs.org/xxhash npm http 304 https://registry.npmjs.org/xxhash
gyp ERR! configure error gyp ERR! stack Error: spawn EACCES gyp ERR! stack at errnoException (child_process.js:980:11) gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:771:34) gyp ERR! System SunOS 5.10 gyp ERR! command "node" "/usr/local/node.js-0.10.22/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" gyp ERR! cwd /home/books/underpage/node_modules/xxhash gyp ERR! node -v v0.10.22 gyp ERR! node-gyp -v v0.11.0 gyp ERR! not ok npm ERR! xxhash@0.2.0 install:
node-gyp rebuild
npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the xxhash@0.2.0 install script. npm ERR! This is most likely a problem with the xxhash 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 xxhash npm ERR! There is likely additional logging output above.npm ERR! System SunOS 5.10 npm ERR! command "/usr/local/node.js-0.10.22/bin/node" "/usr/local/node.js/bin/npm" "i" "xxhash" "--python=/usr/local/python" npm ERR! cwd /home/books/underpage npm ERR! node -v v0.10.22 npm ERR! npm -v 1.3.14 npm ERR! code ELIFECYCLE npm ERR! npm ERR! Additional logging details can be found in: npm ERR! /home/books/underpage/npm-debug.log npm ERR! not ok code 0 [books@atlas ~/underpage]$