Closed bhelx closed 12 years ago
Still does the same thing after installing globally.
BTW, I am seeing this on CentOS and OS X, node version 0.6.15, npm version 1.1.16
This repo is not for 0.6.x I'm suprised you got it to compile, have you tried my fork at englercj/protobuf?
Ah, I never noticed that this was targeted at 0.4. It seems to be doing the same thing with your fork though.
NM, new error. A good sign:
> require('protobuf')
Error: Unable to load shared library /Users/bhelx/code/node/pbtest/node_modules/protobuf/build/Release/protobuf_for_node.node
at Object..node (module.js:472:11)
at Module.load (module.js:348:31)
at Function._load (module.js:308:12)
at Module.require (module.js:354:17)
at require (module.js:370:17)
at repl:1:2
at REPLServer.eval (repl.js:80:21)
at Interface.<anonymous> (repl.js:182:12)
at Interface.emit (events.js:67:17)
at Interface._onLine (readline.js:162:10)
I am on OS X at the moment and I dont have a /etc/ld.so.conf.d
I'm honestly not sure how OS X handles library paths, but you need to add the path to the compiled binary to that path.
There is a new version of protobuf on npm now - http://search.npmjs.org/#/protobuf . I've tested that it works with Node 0.6.9 on Ubuntu. Could you have a look with OSX please?
Well, it's installing with no intervention right now, so that is good. But still getting that error. I think @englercj is correct about the library path issue but altering that on OS X causes issues, especially if you use homebrew. I am going to look into a workaround.
The Unable to load shared library
error is definitely caused by either the compiled output of this package not being on your library path, or the libs built from Google's protobuf engine not being on your library path.
I'm getting the "unable to load shared library" on Ubuntu 10.04 Built protocol buffers direct from google
Adding the path to /Release to ldconfig manually made it go away and it seems to have loaded the library
sudo ldconfig
pwd``
Ok, sorry for the repeated comments. I still have to add the path into ld.so.conf.d
, which is a bit annoying but I'm not sure how to get around that.
Does it really make sense to have a shared libprotobuf_for_node_lib
? I don't want to issue a sudo ldconfig
pwd`` every time I install this package. What's the use case for the shared lib?
@boo Sorry, I have no idea - I didn't write protobuf_for_node, I only packaged it. You're very welcome to fork and change the package so that the functionality of libprotobuf_for_node_lib is integrated into the .node file and send me a pull request.
echo "/usr/local/lib" | tee /etc/ld.so.conf.d/protobuf.conf && ldconfig
this the example result: Message after roundtrip: { "title": "Title" } Number of entries: 2 Proto: 22.96 us / object JSON: 2.58 us / object
much slower than JSON in Node
Now compare the size of the messages when encoded.
Verified working with version 0.3.2 on OS X and Cent OS
Build failed: -> task failed (err #1):
{task: cxx protobuf_for_node.cc -> protobuf_for_node_1.o}
npm ERR! protobuf@0.3.1 install: PROTOBUF=/usr/local/lib node-waf configure clean build
npm ERR! sh "-c" "PROTOBUF=/usr/local/lib node-waf configure clean build"
failed with 1
npm ERR!
npm ERR! Failed at the protobuf@0.3.1 install script.
npm ERR! This is most likely a problem with the protobuf package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! PROTOBUF=/usr/local/lib node-waf configure clean build
npm ERR! You can get their info via:
npm ERR! npm owner ls protobuf
npm ERR! There is likely additional logging output above.
npm ERR! System Darwin 12.1.0 npm ERR! command "/usr/local/Cellar/node/0.8.8/bin/node" "/usr/local/bin/npm" "install" "protobuf" npm ERR! cwd /Users/xcm/Code/work/game_studio/nodejs npm ERR! node -v v0.8.8 npm ERR! npm -v 1.1.59 npm ERR! code ELIFECYCLE npm ERR! npm ERR! Additional logging details can be found in: npm ERR! /Users/xcm/Code/work/game_studio/nodejs/npm-debug.log
every time i try install protobuf on my macos i got this annoying error.
Not sure how to manage this, is there anybody having the same issue?
Compile seems to work out except for a few warnings but node can't find the module when requiring.
Do you think it has something to do with those warnings?